Zubin pushed to branch wip/9.12.3-backports at Glasgow Haskell Compiler / GHC
Commits:
-
05640047
by Simon Peyton Jones at 2025-09-12T17:02:17+05:30
-
42de45fa
by Andreas Klebinger at 2025-09-12T17:02:17+05:30
-
59bd53bf
by Teo Camarasu at 2025-09-12T17:02:17+05:30
-
ab2932da
by Teo Camarasu at 2025-09-12T17:02:17+05:30
-
91b7ffbc
by Reed Mullanix at 2025-09-12T17:02:17+05:30
-
49148aae
by Ben Gamari at 2025-09-12T17:02:17+05:30
-
1b00a659
by Brandon Chinn at 2025-09-12T17:02:17+05:30
-
c389589b
by Luite Stegeman at 2025-09-12T17:02:17+05:30
-
95b15c15
by Zubin Duggal at 2025-09-12T17:02:17+05:30
23 changed files:
- compiler/GHC/CmmToLlvm/Base.hs
- compiler/GHC/CoreToStg/Prep.hs
- compiler/GHC/Driver/Errors/Ppr.hs
- compiler/GHC/Parser/Lexer.x
- compiler/GHC/Tc/Solver/Equality.hs
- configure.ac
- docs/users_guide/9.12.3-notes.rst
- libraries/base/changelog.md
- libraries/ghc-bignum/changelog.md
- libraries/ghc-bignum/src/GHC/Num/Natural.hs
- rts/Messages.c
- rts/StgMiscClosures.cmm
- rts/Updates.h
- testsuite/driver/testlib.py
- + testsuite/tests/numeric/should_run/T26230.hs
- + testsuite/tests/numeric/should_run/T26230.stdout
- testsuite/tests/numeric/should_run/all.T
- + testsuite/tests/partial-sigs/should_compile/T26256.hs
- + testsuite/tests/partial-sigs/should_compile/T26256.stderr
- testsuite/tests/partial-sigs/should_compile/all.T
- testsuite/tests/polykinds/T14172.stderr
- + testsuite/tests/typecheck/should_compile/T26256a.hs
- testsuite/tests/typecheck/should_compile/all.T
Changes:
| ... | ... | @@ -526,10 +526,10 @@ generateExternDecls = do |
| 526 | 526 | modifyEnv $ \env -> env { envAliases = emptyUniqSet }
|
| 527 | 527 | return (concat defss, [])
|
| 528 | 528 | |
| 529 | --- | Is a variable one of the special @$llvm@ globals?
|
|
| 529 | +-- | Is a variable one of the special @\@llvm@ globals?
|
|
| 530 | 530 | isBuiltinLlvmVar :: LlvmVar -> Bool
|
| 531 | 531 | isBuiltinLlvmVar (LMGlobalVar lbl _ _ _ _ _) =
|
| 532 | - "$llvm" `isPrefixOf` unpackFS lbl
|
|
| 532 | + "llvm." `isPrefixOf` unpackFS lbl
|
|
| 533 | 533 | isBuiltinLlvmVar _ = False
|
| 534 | 534 | |
| 535 | 535 | -- | Here we take a global variable definition, rename it with a
|
| ... | ... | @@ -2218,6 +2218,7 @@ mkNonRecFloat env is_unlifted bndr rhs |
| 2218 | 2218 | is_hnf = exprIsHNF rhs
|
| 2219 | 2219 | dmd = idDemandInfo bndr
|
| 2220 | 2220 | is_strict = isStrUsedDmd dmd
|
| 2221 | + |
|
| 2221 | 2222 | ok_for_spec = exprOkForSpecEval call_ok_for_spec rhs
|
| 2222 | 2223 | -- See Note [Controlling Speculative Evaluation]
|
| 2223 | 2224 | call_ok_for_spec x
|
| ... | ... | @@ -276,7 +276,7 @@ instance Diagnostic DriverMessage where |
| 276 | 276 | ++ llvmVersionStr supportedLlvmVersionLowerBound
|
| 277 | 277 | ++ " and "
|
| 278 | 278 | ++ llvmVersionStr supportedLlvmVersionUpperBound
|
| 279 | - ++ ") and reinstall GHC to make -fllvm work")
|
|
| 279 | + ++ ") and reinstall GHC to ensure -fllvm works")
|
|
| 280 | 280 | |
| 281 | 281 | diagnosticReason = \case
|
| 282 | 282 | DriverUnknownMessage m
|
| ... | ... | @@ -347,7 +347,7 @@ instance Diagnostic DriverMessage where |
| 347 | 347 | DriverInstantiationNodeInDependencyGeneration {}
|
| 348 | 348 | -> ErrorWithoutFlag
|
| 349 | 349 | DriverNoConfiguredLLVMToolchain
|
| 350 | - -> ErrorWithoutFlag
|
|
| 350 | + -> WarningWithoutFlag
|
|
| 351 | 351 | |
| 352 | 352 | diagnosticHints = \case
|
| 353 | 353 | DriverUnknownMessage m
|
| ... | ... | @@ -41,6 +41,7 @@ |
| 41 | 41 | -- Alex "Haskell code fragment top"
|
| 42 | 42 | |
| 43 | 43 | {
|
| 44 | +{-# LANGUAGE CPP #-}
|
|
| 44 | 45 | {-# LANGUAGE ViewPatterns #-}
|
| 45 | 46 | {-# LANGUAGE LambdaCase #-}
|
| 46 | 47 | {-# LANGUAGE MultiWayIf #-}
|
| ... | ... | @@ -3370,11 +3371,15 @@ topNoLayoutContainsCommas [] = False |
| 3370 | 3371 | topNoLayoutContainsCommas (ALRLayout _ _ : ls) = topNoLayoutContainsCommas ls
|
| 3371 | 3372 | topNoLayoutContainsCommas (ALRNoLayout b _ : _) = b
|
| 3372 | 3373 | |
| 3374 | +#ifdef MIN_TOOL_VERSION_alex
|
|
| 3375 | +#if !MIN_TOOL_VERSION_alex(3,5,2)
|
|
| 3373 | 3376 | -- If the generated alexScan/alexScanUser functions are called multiple times
|
| 3374 | 3377 | -- in this file, alexScanUser gets broken out into a separate function and
|
| 3375 | 3378 | -- increases memory usage. Make sure GHC inlines this function and optimizes it.
|
| 3376 | 3379 | -- https://github.com/haskell/alex/pull/262
|
| 3377 | 3380 | {-# INLINE alexScanUser #-}
|
| 3381 | +#endif
|
|
| 3382 | +#endif
|
|
| 3378 | 3383 | |
| 3379 | 3384 | lexToken :: P (PsLocated Token)
|
| 3380 | 3385 | lexToken = do
|
| ... | ... | @@ -193,12 +193,8 @@ zonkEqTypes ev eq_rel ty1 ty2 |
| 193 | 193 | then tycon tc1 tys1 tys2
|
| 194 | 194 | else bale_out ty1 ty2
|
| 195 | 195 | |
| 196 | - go ty1 ty2
|
|
| 197 | - | Just (ty1a, ty1b) <- tcSplitAppTyNoView_maybe ty1
|
|
| 198 | - , Just (ty2a, ty2b) <- tcSplitAppTyNoView_maybe ty2
|
|
| 199 | - = do { res_a <- go ty1a ty2a
|
|
| 200 | - ; res_b <- go ty1b ty2b
|
|
| 201 | - ; return $ combine_rev mkAppTy res_b res_a }
|
|
| 196 | + -- If you are temppted to add a case for AppTy/AppTy, be careful
|
|
| 197 | + -- See Note [zonkEqTypes and the PKTI]
|
|
| 202 | 198 | |
| 203 | 199 | go ty1@(LitTy lit1) (LitTy lit2)
|
| 204 | 200 | | lit1 == lit2
|
| ... | ... | @@ -274,6 +270,32 @@ zonkEqTypes ev eq_rel ty1 ty2 |
| 274 | 270 | combine_rev f (Right tys) (Right ty) = Right (f ty tys)
|
| 275 | 271 | |
| 276 | 272 | |
| 273 | +{- Note [zonkEqTypes and the PKTI]
|
|
| 274 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
| 275 | +Because `zonkEqTypes` does /partial/ zonking, we need to be very careful
|
|
| 276 | +to maintain the Purely Kinded Type Invariant: see GHC.Tc.Gen/HsType
|
|
| 277 | +HsNote [The Purely Kinded Type Invariant (PKTI)].
|
|
| 278 | + |
|
| 279 | +In #26256 we try to solve this equality constraint:
|
|
| 280 | + Int :-> Maybe Char ~# k0 Int (m0 Char)
|
|
| 281 | +where m0 and k0 are unification variables, and
|
|
| 282 | + m0 :: Type -> Type
|
|
| 283 | +It happens that m0 was already unified
|
|
| 284 | + m0 := (w0 :: kappa)
|
|
| 285 | +where kappa is another unification variable that is also already unified:
|
|
| 286 | + kappa := Type->Type.
|
|
| 287 | +So the original type satisifed the PKTI, but a partially-zonked form
|
|
| 288 | + k0 Int (w0 Char)
|
|
| 289 | +does not!! (This a bit reminiscent of Note [mkAppTyM].)
|
|
| 290 | + |
|
| 291 | +The solution I have adopted is simply to make `zonkEqTypes` bale out on `AppTy`.
|
|
| 292 | +After all, it's only supposed to be a quick hack to see if two types are already
|
|
| 293 | +equal; if we bale out we'll just get into the "proper" canonicaliser.
|
|
| 294 | + |
|
| 295 | +The only tricky thing about this approach is that it relies on /omitting/
|
|
| 296 | +code -- for the AppTy/AppTy case! Hence this Note
|
|
| 297 | +-}
|
|
| 298 | + |
|
| 277 | 299 | {- *********************************************************************
|
| 278 | 300 | * *
|
| 279 | 301 | * canonicaliseEquality
|
| ... | ... | @@ -22,7 +22,7 @@ AC_INIT([The Glorious Glasgow Haskell Compilation System], [9.12.2], [glasgow-ha |
| 22 | 22 | AC_CONFIG_MACRO_DIRS([m4])
|
| 23 | 23 | |
| 24 | 24 | # Set this to YES for a released version, otherwise NO
|
| 25 | -: ${RELEASE=YES}
|
|
| 25 | +: ${RELEASE=NO}
|
|
| 26 | 26 | |
| 27 | 27 | # The primary version (e.g. 7.5, 7.4.1) is set in the AC_INIT line
|
| 28 | 28 | # above. If this is not a released version, then we will append the
|
| ... | ... | @@ -13,6 +13,83 @@ Compiler |
| 13 | 13 | |
| 14 | 14 | - Fixed re-exports of ``MkSolo`` and ``MkSolo#`` (:ghc-ticket:`25182`)
|
| 15 | 15 | - Fixed the behavior of ``Language.Haskell.TH.mkName "FUN"`` (:ghc-ticket:`25174`)
|
| 16 | +- Fixed miscompilation involving ``zonkEqTypes`` on ``AppTy/AppTy`` (:ghc-ticket:`26256`)
|
|
| 17 | +- Fixed CprAnal to detect recursive newtypes (:ghc-ticket:`25944`)
|
|
| 18 | +- Fixed specialisation of incoherent instances (:ghc-ticket:`25883`)
|
|
| 19 | +- Fixed bytecode generation for ``tagToEnum# <LITERAL>`` (:ghc-ticket:`25975`)
|
|
| 20 | +- Fixed panic with EmptyCase and RequiredTypeArguments (:ghc-ticket:`25004`)
|
|
| 21 | +- Fixed ``tyConStupidTheta`` to handle ``PromotedDataCon`` (:ghc-ticket:`25739`)
|
|
| 22 | +- Fixed unused import warnings for duplicate record fields (:ghc-ticket:`24035`)
|
|
| 23 | +- Fixed lexing of ``"\^\"`` (:ghc-ticket:`25937`)
|
|
| 24 | +- Fixed string gap collapsing (:ghc-ticket:`25784`)
|
|
| 25 | +- Fixed lexing of comments in multiline strings (:ghc-ticket:`25609`)
|
|
| 26 | +- Made unexpected LLVM versions a warning rather than an error (:ghc-ticket:`25915`)
|
|
| 27 | +- Disabled ``-fprof-late-overloaded-calls`` for join points to avoid invalid transformations
|
|
| 28 | +- Fixed bugs in ``integerRecipMod`` and ``integerPowMod`` (:ghc-ticket:`26017`)
|
|
| 29 | +- Fixed ``naturalAndNot`` for NB/NS case (:ghc-ticket:`26230`)
|
|
| 30 | +- Fixed ``ds_ev_typeable`` to use ``mkTrAppChecked`` (:ghc-ticket:`25998`)
|
|
| 31 | +- Fixed GHC settings to always unescape escaped spaces (:ghc-ticket:`25204`)
|
|
| 32 | +- Fixed issue with HasCallStack constraint caching (:ghc-ticket:`25529`)
|
|
| 33 | +- Fixed archive member size writing logic in ``GHC.SysTools.Ar`` (:ghc-ticket:`26120`, :ghc-ticket:`22586`)
|
|
| 34 | + |
|
| 35 | +Runtime System
|
|
| 36 | +~~~~~~~~~~~~~~
|
|
| 37 | + |
|
| 38 | +- Fixed ``MessageBlackHole.link`` to always be a valid closure
|
|
| 39 | +- Fixed handling of WHITEHOLE in ``messageBlackHole`` (:ghc-ticket:`26205`)
|
|
| 40 | +- Fixed ``rts_clearMemory`` logic when sanity checks are enabled (:ghc-ticket:`26011`)
|
|
| 41 | +- Fixed underflow frame lookups in the bytecode interpreter (:ghc-ticket:`25750`)
|
|
| 42 | +- Fixed overflows and reentrancy in interpreter statistics calculation (:ghc-ticket:`25756`)
|
|
| 43 | +- Fixed INTERP_STATS profiling code (:ghc-ticket:`25695`)
|
|
| 44 | +- Removed problematic ``n_free`` variable from nonmovingGC (:ghc-ticket:`26186`)
|
|
| 45 | +- Fixed incorrect format specifiers in era profiling
|
|
| 46 | +- Improved documentation of SLIDE and PACK bytecode instructions
|
|
| 47 | +- Eliminated redundant ``SLIDE x 0`` bytecode instructions
|
|
| 48 | +- Fixed compile issues on powerpc64 ELF v1
|
|
| 49 | + |
|
| 50 | +Code Generation
|
|
| 51 | +~~~~~~~~~~~~~~~
|
|
| 52 | + |
|
| 53 | +- Fixed LLVM built-in variable predicate (was checking ``$llvm`` instead of ``@llvm``)
|
|
| 54 | +- Fixed linkage of built-in arrays for LLVM (:ghc-ticket:`25769`)
|
|
| 55 | +- Fixed code generation for SSE vector operations (:ghc-ticket:`25859`)
|
|
| 56 | +- Fixed ``bswap64`` code generation on i386 (:ghc-ticket:`25601`)
|
|
| 57 | +- Fixed sub-word arithmetic right shift on AArch64 (:ghc-ticket:`26061`)
|
|
| 58 | +- Fixed LLVM vector literal emission to include type information
|
|
| 59 | +- Fixed LLVM version detection
|
|
| 60 | +- Fixed typo in ``padLiveArgs`` that caused segfaults (:ghc-ticket:`25770`, :ghc-ticket:`25773`)
|
|
| 61 | +- Fixed constant-folding for Word->Float bitcasts
|
|
| 62 | +- Added surface syntax for Word/Float bitcast operations
|
|
| 63 | +- Fixed ``MOVD`` format in x86 NCG for ``unpackInt64X2#``
|
|
| 64 | +- Added ``-finter-module-far-jumps`` flag for AArch64
|
|
| 65 | +- Fixed RV64 J instruction handling for non-local jumps (:ghc-ticket:`25738`)
|
|
| 66 | +- Reapplied division by constants optimization
|
|
| 67 | +- Fixed TNTC to set CmmProc entry_label properly (:ghc-ticket:`25565`)
|
|
| 68 | + |
|
| 69 | +Linker
|
|
| 70 | +~~~~~~
|
|
| 71 | + |
|
| 72 | +- Improved efficiency of proddable blocks structure (:ghc-ticket:`26009`)
|
|
| 73 | +- Fixed Windows DLL loading to avoid redundant ``LoadLibraryEx`` calls (:ghc-ticket:`26009`)
|
|
| 74 | +- Fixed incorrect use of ``break`` in nested for loop (:ghc-ticket:`26052`)
|
|
| 75 | +- Fixed linker to not fail due to ``RTLD_NOW`` (:ghc-ticket:`25943`)
|
|
| 76 | +- Dropped obsolete Windows XP compatibility checks
|
|
| 77 | + |
|
| 78 | +GHCi
|
|
| 79 | +~~~~
|
|
| 80 | + |
|
| 81 | +- Fixed ``mkTopLevEnv`` to use ``loadInterfaceForModule`` instead of ``loadSrcInterface`` (:ghc-ticket:`25951`)
|
|
| 82 | + |
|
| 83 | +Template Haskell
|
|
| 84 | +~~~~~~~~~~~~~~~~
|
|
| 85 | + |
|
| 86 | +- Added explicit export lists to all remaining template-haskell modules
|
|
| 87 | + |
|
| 88 | +Build system
|
|
| 89 | +~~~~~~~~~~~~~~~~
|
|
| 90 | + |
|
| 91 | +- Exposed all of Backtraces' internals for ghc-internal (:ghc-ticket:`26049`)
|
|
| 92 | +- Fixed cross-compilation configuration override (:ghc-ticket:`26236`)
|
|
| 16 | 93 | |
| 17 | 94 | Included libraries
|
| 18 | 95 | ~~~~~~~~~~~~~~~~~~
|
| 1 | 1 | # Changelog for [`base` package](http://hackage.haskell.org/package/base)
|
| 2 | 2 | |
| 3 | +## 4.21.2.0 *Sept 2024*
|
|
| 4 | + * Fix bug where `naturalAndNot` was incorrectly truncating results ([CLC proposal #350](github.com/haskell/core-libraries-committee/issues/350))
|
|
| 5 | + |
|
| 3 | 6 | ## 4.21.1.0 *Sept 2024*
|
| 4 | 7 | * Fix incorrect results of `integerPowMod` when the base is 0 and the exponent is negative, and `integerRecipMod` when the modulus is zero ([#26017](https://gitlab.haskell.org/ghc/ghc/-/issues/26017)).
|
| 5 | 8 |
| ... | ... | @@ -4,6 +4,7 @@ |
| 4 | 4 | |
| 5 | 5 | - Expose backendName
|
| 6 | 6 | - Add `naturalSetBit[#]` (#21173), `naturalClearBit[#]` (#21175), `naturalComplementBit[#]` (#21181)
|
| 7 | +- Fix bug where `naturalAndNot` was incorrectly truncating results (#26230)
|
|
| 7 | 8 | |
| 8 | 9 | ## 1.2
|
| 9 | 10 |
| ... | ... | @@ -488,7 +488,7 @@ naturalAndNot :: Natural -> Natural -> Natural |
| 488 | 488 | {-# NOINLINE naturalAndNot #-}
|
| 489 | 489 | naturalAndNot (NS n) (NS m) = NS (n `and#` not# m)
|
| 490 | 490 | naturalAndNot (NS n) (NB m) = NS (n `and#` not# (bigNatToWord# m))
|
| 491 | -naturalAndNot (NB n) (NS m) = NS (bigNatToWord# n `and#` not# m)
|
|
| 491 | +naturalAndNot (NB n) (NS m) = NB (bigNatAndNotWord# n m)
|
|
| 492 | 492 | naturalAndNot (NB n) (NB m) = naturalFromBigNat# (bigNatAndNot n m)
|
| 493 | 493 | |
| 494 | 494 | naturalOr :: Natural -> Natural -> Natural
|
| ... | ... | @@ -180,13 +180,22 @@ uint32_t messageBlackHole(Capability *cap, MessageBlackHole *msg) |
| 180 | 180 | bh_info != &stg_CAF_BLACKHOLE_info &&
|
| 181 | 181 | bh_info != &__stg_EAGER_BLACKHOLE_info &&
|
| 182 | 182 | bh_info != &stg_WHITEHOLE_info) {
|
| 183 | - // if it is a WHITEHOLE, then a thread is in the process of
|
|
| 184 | - // trying to BLACKHOLE it. But we know that it was once a
|
|
| 185 | - // BLACKHOLE, so there is at least a valid pointer in the
|
|
| 186 | - // payload, so we can carry on.
|
|
| 187 | 183 | return 0;
|
| 188 | 184 | }
|
| 189 | 185 | |
| 186 | + // If we see a WHITEHOLE then we should wait for it to turn into a BLACKHOLE.
|
|
| 187 | + // Otherwise we might look at the indirectee and segfault.
|
|
| 188 | + // See "Exception handling" in Note [Thunks, blackholes, and indirections]
|
|
| 189 | + // We might be looking at a *fresh* THUNK being WHITEHOLE-d so we can't
|
|
| 190 | + // guarantee that the indirectee is a valid pointer.
|
|
| 191 | +#if defined(THREADED_RTS)
|
|
| 192 | + if (bh_info == &stg_WHITEHOLE_info) {
|
|
| 193 | + while(ACQUIRE_LOAD(&bh->header.info) == &stg_WHITEHOLE_info) {
|
|
| 194 | + busy_wait_nop();
|
|
| 195 | + }
|
|
| 196 | + }
|
|
| 197 | +#endif
|
|
| 198 | + |
|
| 190 | 199 | // The blackhole must indirect to a TSO, a BLOCKING_QUEUE, an IND,
|
| 191 | 200 | // or a value.
|
| 192 | 201 | StgClosure *p;
|
| ... | ... | @@ -31,6 +31,7 @@ import CLOSURE ENT_VIA_NODE_ctr; |
| 31 | 31 | import CLOSURE RtsFlags;
|
| 32 | 32 | import CLOSURE stg_BLOCKING_QUEUE_CLEAN_info;
|
| 33 | 33 | import CLOSURE stg_BLOCKING_QUEUE_DIRTY_info;
|
| 34 | +import CLOSURE stg_END_TSO_QUEUE_closure;
|
|
| 34 | 35 | import CLOSURE stg_IND_info;
|
| 35 | 36 | import CLOSURE stg_MSG_BLACKHOLE_info;
|
| 36 | 37 | import CLOSURE stg_TSO_info;
|
| ... | ... | @@ -574,6 +575,9 @@ retry: |
| 574 | 575 | |
| 575 | 576 | MessageBlackHole_tso(msg) = CurrentTSO;
|
| 576 | 577 | MessageBlackHole_bh(msg) = node;
|
| 578 | + // Ensure that the link field is a valid closure,
|
|
| 579 | + // since we might turn this into an indirection in wakeBlockingQueue()
|
|
| 580 | + MessageBlackHole_link(msg) = stg_END_TSO_QUEUE_closure;
|
|
| 577 | 581 | SET_HDR(msg, stg_MSG_BLACKHOLE_info, CCS_SYSTEM);
|
| 578 | 582 | // messageBlackHole has appropriate memory barriers when this object is exposed.
|
| 579 | 583 | // See Note [Heap memory barriers].
|
| ... | ... | @@ -333,6 +333,10 @@ |
| 333 | 333 | * `AP_STACK` closure recording the aborted execution state.
|
| 334 | 334 | * See `RaiseAsync.c:raiseAsync` for details.
|
| 335 | 335 | *
|
| 336 | + * This can combine with indirection shortcutting during GC to replace a BLACKHOLE
|
|
| 337 | + * with a fresh THUNK. We should be very careful here since the THUNK will have an
|
|
| 338 | + * undefined value in the indirectee field. Looking at the indirectee field can then
|
|
| 339 | + * lead to a segfault such as #26205.
|
|
| 336 | 340 | *
|
| 337 | 341 | * CAFs
|
| 338 | 342 | * ----
|
| ... | ... | @@ -1725,7 +1725,7 @@ async def do_test(name: TestName, |
| 1725 | 1725 | dst_makefile = in_testdir('Makefile')
|
| 1726 | 1726 | if src_makefile.exists():
|
| 1727 | 1727 | makefile = src_makefile.read_text(encoding='UTF-8')
|
| 1728 | - makefile = re.sub('TOP=.*', 'TOP=%s' % config.top, makefile, 1)
|
|
| 1728 | + makefile = re.sub('TOP=.*', 'TOP=%s' % config.top, makefile, count=1)
|
|
| 1729 | 1729 | dst_makefile.write_text(makefile, encoding='UTF-8')
|
| 1730 | 1730 | |
| 1731 | 1731 | if opts.pre_cmd:
|
| 1 | +import Data.Bits
|
|
| 2 | +import GHC.Num.Natural
|
|
| 3 | + |
|
| 4 | +main = do
|
|
| 5 | + print $ naturalAndNot ((2 ^ 4) .|. (2 ^ 3)) (2 ^ 3)
|
|
| 6 | + print $ naturalAndNot ((2 ^ 129) .|. (2 ^ 65)) (2 ^ 65)
|
|
| 7 | + print $ naturalAndNot ((2 ^ 4) .|. (2 ^ 3)) ((2 ^ 65) .|. (2 ^ 3))
|
|
| 8 | + print $ naturalAndNot ((2 ^ 65) .|. (2 ^ 3)) (2 ^ 3) |
| 1 | +16
|
|
| 2 | +680564733841876926926749214863536422912
|
|
| 3 | +16
|
|
| 4 | +36893488147419103232 |
| ... | ... | @@ -87,3 +87,4 @@ test('T24066', normal, compile_and_run, ['']) |
| 87 | 87 | test('div01', normal, compile_and_run, [''])
|
| 88 | 88 | test('T24245', normal, compile_and_run, [''])
|
| 89 | 89 | test('T25653', normal, compile_and_run, [''])
|
| 90 | +test('T26230', normal, compile_and_run, ['']) |
| 1 | +{-# LANGUAGE GHC2021 #-}
|
|
| 2 | +{-# LANGUAGE TypeFamilies #-}
|
|
| 3 | +{-# LANGUAGE PartialTypeSignatures #-}
|
|
| 4 | + |
|
| 5 | +module M (go) where
|
|
| 6 | + |
|
| 7 | +import Data.Kind
|
|
| 8 | + |
|
| 9 | +type Apply :: (Type -> Type) -> Type
|
|
| 10 | +data Apply m
|
|
| 11 | + |
|
| 12 | +type (:->) :: Type -> Type -> Type
|
|
| 13 | +type family (:->) where (:->) = (->)
|
|
| 14 | + |
|
| 15 | +f :: forall (k :: Type -> Type -> Type) (m :: Type -> Type).
|
|
| 16 | + k Int (m Char) -> k Bool (Apply m)
|
|
| 17 | +f = f
|
|
| 18 | + |
|
| 19 | +x :: Int :-> Maybe Char
|
|
| 20 | +x = x
|
|
| 21 | + |
|
| 22 | +go :: Bool -> _ _
|
|
| 23 | +go = f x |
| 1 | +T26256.hs:22:15: warning: [GHC-88464] [-Wpartial-type-signatures (in -Wdefault)]
|
|
| 2 | + • Found type wildcard ‘_’ standing for ‘Apply :: (* -> *) -> *’
|
|
| 3 | + • In the type signature: go :: Bool -> _ _
|
|
| 4 | + |
|
| 5 | +T26256.hs:22:17: warning: [GHC-88464] [-Wpartial-type-signatures (in -Wdefault)]
|
|
| 6 | + • Found type wildcard ‘_’ standing for ‘Maybe :: * -> *’
|
|
| 7 | + • In the first argument of ‘_’, namely ‘_’
|
|
| 8 | + In the type signature: go :: Bool -> _ _ |
| ... | ... | @@ -108,3 +108,4 @@ test('T21667', normal, compile, ['']) |
| 108 | 108 | test('T22065', normal, compile, [''])
|
| 109 | 109 | test('T16152', normal, compile, [''])
|
| 110 | 110 | test('T20076', expect_broken(20076), compile, [''])
|
| 111 | +test('T26256', normal, compile, ['']) |
| 1 | 1 | T14172.hs:7:46: error: [GHC-88464]
|
| 2 | - • Found type wildcard ‘_’ standing for ‘a'1 :: k0’
|
|
| 3 | - Where: ‘k0’ is an ambiguous type variable
|
|
| 2 | + • Found type wildcard ‘_’ standing for ‘a'1 :: k30’
|
|
| 3 | + Where: ‘k30’ is an ambiguous type variable
|
|
| 4 | 4 | ‘a'1’ is an ambiguous type variable
|
| 5 | 5 | To use the inferred type, enable PartialTypeSignatures
|
| 6 | 6 | • In the first argument of ‘h’, namely ‘_’
|
| 1 | +{-# LANGUAGE GHC2021 #-}
|
|
| 2 | +{-# LANGUAGE TypeFamilies #-}
|
|
| 3 | + |
|
| 4 | +module T26256 (go) where
|
|
| 5 | + |
|
| 6 | +import Data.Kind
|
|
| 7 | + |
|
| 8 | +class Cat k where (<<<) :: k a b -> k x a -> k x b
|
|
| 9 | +instance Cat (->) where (<<<) = (.)
|
|
| 10 | +class Pro k p where pro :: k a b s t -> p a b -> p s t
|
|
| 11 | +data Hiding o a b s t = forall e. Hiding (s -> o e a)
|
|
| 12 | +newtype Apply e a = Apply (e a)
|
|
| 13 | + |
|
| 14 | +type (:->) :: Type -> Type -> Type
|
|
| 15 | +type family (:->) where
|
|
| 16 | + (:->) = (->)
|
|
| 17 | + |
|
| 18 | +go :: (Pro (Hiding Apply) p) => (s :-> e a) -> p a b -> p s t
|
|
| 19 | +go sea = pro (Hiding (Apply <<< sea)) |
| ... | ... | @@ -935,3 +935,4 @@ test('T24845a', normal, compile, ['']) |
| 935 | 935 | test('T23501a', normal, compile, [''])
|
| 936 | 936 | test('T23501b', normal, compile, [''])
|
| 937 | 937 | test('T25597', normal, compile, [''])
|
| 938 | +test('T26256a', normal, compile, ['']) |