Simon Peyton Jones pushed to branch wip/T23162-spj at Glasgow Haskell Compiler / GHC
Commits:
-
e61cec2a
by Simon Peyton Jones at 2025-09-26T10:32:06+01:00
17 changed files:
- compiler/GHC/Tc/Errors.hs
- compiler/GHC/Tc/Gen/App.hs
- compiler/GHC/Tc/Solver/FunDeps.hs
- compiler/GHC/Tc/Types/Constraint.hs
- compiler/GHC/Tc/Types/Origin.hs
- compiler/GHC/Tc/Utils/TcMType.hs
- testsuite/tests/default/default-fail05.stderr
- testsuite/tests/indexed-types/should_fail/T1897b.stderr
- testsuite/tests/indexed-types/should_fail/T9662.stderr
- testsuite/tests/parser/should_fail/RecordDotSyntaxFail10.stderr
- testsuite/tests/parser/should_fail/RecordDotSyntaxFail13.stderr
- testsuite/tests/partial-sigs/should_fail/T14040a.stderr
- testsuite/tests/rep-poly/RepPolyRightSection.stderr
- testsuite/tests/typecheck/no_skolem_info/T14040.stderr
- − testsuite/tests/typecheck/should_compile/T13651.stderr
- testsuite/tests/typecheck/should_compile/all.T
- testsuite/tests/typecheck/should_fail/T8603.stderr
Changes:
| ... | ... | @@ -778,8 +778,8 @@ Which errors are suppressed? |
| 778 | 778 | |
| 779 | 779 | Historical (SCE2). Fundep constraints never "escape" into the
|
| 780 | 780 | main solver and so never show up in error messages.
|
| 781 | - See Note [Functional dependencies in type inference] inb GHC.Tc.Solver.FunDeps.
|
|
| 782 | - So this wrinkle is now just a historical note.
|
|
| 781 | + See (SOLVE-FD) in Note [Overview of functional dependencies in type inference]
|
|
| 782 | + in GHC.Tc.Solver.FunDeps. So this wrinkle is now just a historical note.
|
|
| 783 | 783 | |
| 784 | 784 | Errors which arise from the interaction of two Wanted fun-dep constraints.
|
| 785 | 785 | Example:
|
| ... | ... | @@ -929,7 +929,7 @@ newFlexiTyVarQL :: QLFlag -> OccName -> MetaInfo -> TcKind -> TcM TcTyVar |
| 929 | 929 | newFlexiTyVarQL do_ql occ info kind
|
| 930 | 930 | = do { lvl <- getTcLevelQL do_ql
|
| 931 | 931 | ; ref <- newMutVar Flexi
|
| 932 | - ; name <- newSysName occ -- See Note [Name of an unification variable]
|
|
| 932 | + ; name <- newSysName occ -- See Note [Name of a unification variable]
|
|
| 933 | 933 | -- in GHC.Tc.Utils.TcMType
|
| 934 | 934 | ; let details = MetaTv { mtv_info = info
|
| 935 | 935 | , mtv_ref = ref
|
| ... | ... | @@ -41,33 +41,33 @@ import GHC.Data.Pair |
| 41 | 41 | import Data.Maybe( mapMaybe )
|
| 42 | 42 | |
| 43 | 43 | |
| 44 | -{- Note [Functional dependencies in type inference]
|
|
| 45 | -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
| 44 | +{- Note [Overview of functional dependencies in type inference]
|
|
| 45 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
| 46 | 46 | Here is our plan for dealing with functional dependencies
|
| 47 | 47 | |
| 48 | 48 | * When we have failed to solve a Wanted constraint, do this
|
| 49 | - 1. Generate any fundep-equalities [FunDepEqns] from that constraint.
|
|
| 50 | - 2. Try to solve that [FunDepEqns]
|
|
| 51 | - 3. If any unifications happened, send the constraint back to the
|
|
| 52 | - start of the pipeline
|
|
| 53 | - |
|
| 54 | -* Step (1) How we generate those [FunDepEqns] varies:
|
|
| 49 | + - (GEN-FD) Generate any fundep-equalities [FunDepEqns] from that constraint.
|
|
| 50 | + - (SOLVE-FD) Try to solve that [FunDepEqns]
|
|
| 51 | + - (KICK-FD) If any unifications happened,
|
|
| 52 | + * kick out any inert constraints that mention the unified variables
|
|
| 53 | + * send the current constraint back to the start of the pipeline;
|
|
| 54 | + might now be soluble, and it probably isn't inert
|
|
| 55 | + |
|
| 56 | +* (GEN-FD) How we generate those [FunDepEqns] varies:
|
|
| 55 | 57 | - tryDictFunDeps: for class constraints (C t1 .. tn)
|
| 56 | 58 | we look at top-level instances and inert Givens
|
| 57 | 59 | - tryEqFunDeps: for type-family equalities (F t1 .. tn ~ ty)
|
| 58 | 60 | we look at top-level family instances
|
| 59 | 61 | and inert Given family equalities
|
| 60 | 62 | |
| 61 | -* Step (2). We use `solveFunDeps` to solve the [FunDepEqns] in a nested
|
|
| 63 | +* (SOLVE-FD) We use `solveFunDeps` to solve the [FunDepEqns] in a nested
|
|
| 62 | 64 | solver. Key property:
|
| 63 | 65 | |
| 64 | 66 | The ONLY effect of `solveFunDeps` is possibly to perform unifications:
|
| 65 | - |
|
| 66 | 67 | - It entirely discards any unsolved fundep equalities.
|
| 67 | - |
|
| 68 | 68 | - It entirely discards any evidence arising from solving fundep equalities
|
| 69 | 69 | |
| 70 | -* Step (3) if we did any unifications in Step (2), we start again with the
|
|
| 70 | +* (KICK-FD) if we did any unifications in (SOLVE-FD), we start again with the
|
|
| 71 | 71 | current unsolved Wanted. It might now be soluble!
|
| 72 | 72 | |
| 73 | 73 | * For Given constraints, things are different:
|
| ... | ... | @@ -518,7 +518,8 @@ mkTopUserFamEqFDs fam_tc inj_flags work_args work_rhs |
| 518 | 518 | in_scope = mkInScopeSet (tyCoVarsOfType work_rhs)
|
| 519 | 519 | |
| 520 | 520 | trim_qtvs :: Subst -> [TcTyVar] -> (Subst,[TcTyVar])
|
| 521 | - -- Tricky stuff: see (TF1) in Note [Fundeps and top-level family instances]
|
|
| 521 | + -- Tricky stuff: see (TIF1) in
|
|
| 522 | + -- Note [Type inference for type families with injectivity]
|
|
| 522 | 523 | trim_qtvs subst [] = (subst, [])
|
| 523 | 524 | trim_qtvs subst (tv:tvs)
|
| 524 | 525 | | tv `elemSubst` subst = trim_qtvs subst tvs
|
| ... | ... | @@ -765,7 +766,7 @@ solveFunDeps :: CtEvidence -- The work item |
| 765 | 766 | --
|
| 766 | 767 | -- The returned Bool is True if some unifications happened
|
| 767 | 768 | --
|
| 768 | --- See Note [Overview of fundeps]
|
|
| 769 | +-- See (SOLVE-FD) in Note [Overview of functional dependencies in type inference]
|
|
| 769 | 770 | solveFunDeps work_ev fd_eqns
|
| 770 | 771 | | null fd_eqns
|
| 771 | 772 | = return False -- Common case no-op
|
| ... | ... | @@ -1330,7 +1330,7 @@ can't be solved. But not quite all such constraints; see wrinkles. |
| 1330 | 1330 | (IW4) Historical note: we used to have equalities arising from
|
| 1331 | 1331 | Wanted/Wanted fundep interactions, which we did not want to treat
|
| 1332 | 1332 | as insoluble. But now such fundep constraints never escape.
|
| 1333 | - See Note [Functional dependencies in type inference]
|
|
| 1333 | + See Note [Overview of functional dependencies in type inference]
|
|
| 1334 | 1334 | |
| 1335 | 1335 | Note [Insoluble holes]
|
| 1336 | 1336 | ~~~~~~~~~~~~~~~~~~~~~~
|
| ... | ... | @@ -598,9 +598,10 @@ data CtOrigin |
| 598 | 598 | | ArrowCmdOrigin -- Arising from an arrow command
|
| 599 | 599 | | AnnOrigin -- An annotation
|
| 600 | 600 | |
| 601 | - | FunDepOrigin -- A functional dependency. We don't need auxiliary info
|
|
| 602 | - -- because fundep constraints never show up in errors
|
|
| 603 | - -- See Note [Functional dependencies in type inference]
|
|
| 601 | + | FunDepOrigin -- A functional dependency.
|
|
| 602 | + -- We don't need auxiliary info because fundep constraints
|
|
| 603 | + -- never show up in errors. See (SOLVE-FD) in
|
|
| 604 | + -- Note [Overview of functional dependencies in type inference]
|
|
| 604 | 605 | |
| 605 | 606 | | InjTFOrigin1 -- injective type family equation combining
|
| 606 | 607 | PredType CtOrigin RealSrcSpan -- This constraint arising from ...
|
| ... | ... | @@ -716,14 +716,14 @@ Proposal 29). |
| 716 | 716 | |
| 717 | 717 | Note [Name of a unification variable]
|
| 718 | 718 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
| 719 | -We give unification variables a /System/ Name, which is eagerly elmininated
|
|
| 720 | -the the unifier; see GHC.Tc.Utils.Unify.nicer_to_update_tv1, and
|
|
| 721 | -GHC.Tc.Solver.Equality.canEqTyVarTyVar (nicer_to_update_tv2)
|
|
| 722 | - |
|
| 723 | -Note [Name of an instantiated type variable]
|
|
| 724 | -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
| 725 | -At the moment we give a unification variable a System Name, which
|
|
| 726 | -influences the way it is tidied; see TypeRep.tidyTyVarBndr.
|
|
| 719 | +We give unification variables a /System/ Name, which is treated specially
|
|
| 720 | +in two ways
|
|
| 721 | + |
|
| 722 | +* It is eagerly elmininated the the unifier; see
|
|
| 723 | + GHC.Tc.Utils.Unify.nicer_to_update_tv1, and
|
|
| 724 | + GHC.Tc.Solver.Equality.canEqTyVarTyVar (nicer_to_update_tv2)
|
|
| 725 | + |
|
| 726 | +* It influences the way it is tidied; see TypeRep.tidyTyVarBndr.
|
|
| 727 | 727 | -}
|
| 728 | 728 | |
| 729 | 729 | newMetaTyVarName :: FastString -> TcM Name
|
| ... | ... | @@ -732,7 +732,7 @@ newMetaTyVarName str |
| 732 | 732 | = newSysName (mkTyVarOccFS str)
|
| 733 | 733 | |
| 734 | 734 | cloneMetaTyVarName :: Name -> TcM Name
|
| 735 | --- See Note [Name of an instantiated type variable]
|
|
| 735 | +-- Makes a /System/ Name; see Note [Name of a unification variable]
|
|
| 736 | 736 | cloneMetaTyVarName name
|
| 737 | 737 | = newSysName (nameOccName name)
|
| 738 | 738 |
| 1 | 1 | default-fail05.hs:11:10: error: [GHC-39999]
|
| 2 | - • Ambiguous type variable ‘t0’ arising from a use of ‘toList’
|
|
| 3 | - prevents the constraint ‘(Foldable t0)’ from being solved.
|
|
| 4 | - Probable fix: use a type annotation to specify what ‘t0’ should be.
|
|
| 2 | + • Ambiguous type variable ‘f0’ arising from a use of ‘toList’
|
|
| 3 | + prevents the constraint ‘(Foldable f0)’ from being solved.
|
|
| 4 | + Probable fix: use a type annotation to specify what ‘f0’ should be.
|
|
| 5 | 5 | Potentially matching instances:
|
| 6 | 6 | instance Foldable (Either a)
|
| 7 | 7 | -- Defined in ‘GHC.Internal.Data.Foldable’
|
| ... | ... | @@ -14,9 +14,9 @@ default-fail05.hs:11:10: error: [GHC-39999] |
| 14 | 14 | In a stmt of a 'do' block: print (toList $ pure 21)
|
| 15 | 15 | |
| 16 | 16 | default-fail05.hs:11:19: error: [GHC-39999]
|
| 17 | - • Ambiguous type variable ‘t0’ arising from a use of ‘pure’
|
|
| 18 | - prevents the constraint ‘(Applicative t0)’ from being solved.
|
|
| 19 | - Probable fix: use a type annotation to specify what ‘t0’ should be.
|
|
| 17 | + • Ambiguous type variable ‘f0’ arising from a use of ‘pure’
|
|
| 18 | + prevents the constraint ‘(Applicative f0)’ from being solved.
|
|
| 19 | + Probable fix: use a type annotation to specify what ‘f0’ should be.
|
|
| 20 | 20 | Potentially matching instances:
|
| 21 | 21 | instance Applicative IO -- Defined in ‘GHC.Internal.Base’
|
| 22 | 22 | instance Applicative Maybe -- Defined in ‘GHC.Internal.Base’
|
| ... | ... | @@ -28,11 +28,11 @@ default-fail05.hs:11:19: error: [GHC-39999] |
| 28 | 28 | In a stmt of a 'do' block: print (toList $ pure 21)
|
| 29 | 29 | |
| 30 | 30 | default-fail05.hs:12:3: error: [GHC-39999]
|
| 31 | - • Ambiguous type variable ‘t1’ arising from a use of ‘traverse’
|
|
| 32 | - prevents the constraint ‘(Traversable t1)’ from being solved.
|
|
| 31 | + • Ambiguous type variable ‘t0’ arising from a use of ‘traverse’
|
|
| 32 | + prevents the constraint ‘(Traversable t0)’ from being solved.
|
|
| 33 | 33 | Relevant bindings include
|
| 34 | - main :: IO (t1 ()) (bound at default-fail05.hs:10:1)
|
|
| 35 | - Probable fix: use a type annotation to specify what ‘t1’ should be.
|
|
| 34 | + main :: IO (t0 ()) (bound at default-fail05.hs:10:1)
|
|
| 35 | + Probable fix: use a type annotation to specify what ‘t0’ should be.
|
|
| 36 | 36 | Potentially matching instances:
|
| 37 | 37 | instance Traversable (Either a)
|
| 38 | 38 | -- Defined in ‘GHC.Internal.Data.Traversable’
|
| ... | ... | @@ -51,11 +51,11 @@ default-fail05.hs:12:3: error: [GHC-39999] |
| 51 | 51 | traverse print (pure 42)
|
| 52 | 52 | |
| 53 | 53 | default-fail05.hs:12:19: error: [GHC-39999]
|
| 54 | - • Ambiguous type variable ‘t1’ arising from a use of ‘pure’
|
|
| 55 | - prevents the constraint ‘(Applicative t1)’ from being solved.
|
|
| 54 | + • Ambiguous type variable ‘t0’ arising from a use of ‘pure’
|
|
| 55 | + prevents the constraint ‘(Applicative t0)’ from being solved.
|
|
| 56 | 56 | Relevant bindings include
|
| 57 | - main :: IO (t1 ()) (bound at default-fail05.hs:10:1)
|
|
| 58 | - Probable fix: use a type annotation to specify what ‘t1’ should be.
|
|
| 57 | + main :: IO (t0 ()) (bound at default-fail05.hs:10:1)
|
|
| 58 | + Probable fix: use a type annotation to specify what ‘t0’ should be.
|
|
| 59 | 59 | Potentially matching instances:
|
| 60 | 60 | instance Applicative IO -- Defined in ‘GHC.Internal.Base’
|
| 61 | 61 | instance Applicative Maybe -- Defined in ‘GHC.Internal.Base’
|
| 1 | 1 | T1897b.hs:16:1: error: [GHC-83865]
|
| 2 | - • Couldn't match type: Depend a0
|
|
| 3 | - with: Depend a
|
|
| 4 | - Expected: t (Depend a) -> Bool
|
|
| 5 | - Actual: t (Depend a0) -> Bool
|
|
| 2 | + • Couldn't match type: Depend b0
|
|
| 3 | + with: Depend b
|
|
| 4 | + Expected: t (Depend b) -> Bool
|
|
| 5 | + Actual: t (Depend b0) -> Bool
|
|
| 6 | 6 | Note: ‘Depend’ is a non-injective type family.
|
| 7 | - The type variable ‘a0’ is ambiguous
|
|
| 7 | + The type variable ‘b0’ is ambiguous
|
|
| 8 | 8 | • In the ambiguity check for the inferred type for ‘isValid’
|
| 9 | 9 | To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
|
| 10 | 10 | When checking the inferred type
|
| 11 | - isValid :: forall {t :: * -> *} {a}.
|
|
| 12 | - (Foldable t, Bug a) =>
|
|
| 13 | - t (Depend a) -> Bool
|
|
| 11 | + isValid :: forall {t :: * -> *} {b}.
|
|
| 12 | + (Foldable t, Bug b) =>
|
|
| 13 | + t (Depend b) -> Bool
|
|
| 14 | 14 |
| 1 | 1 | T9662.hs:49:8: error: [GHC-25897]
|
| 2 | - • Couldn't match type ‘k’ with ‘Int’
|
|
| 2 | + • Couldn't match type ‘n’ with ‘Int’
|
|
| 3 | 3 | Expected: Exp (((sh :. k) :. m) :. n)
|
| 4 | 4 | -> Exp (((sh :. m) :. n) :. k)
|
| 5 | 5 | Actual: Exp
|
| 6 | 6 | (Tuple (((Atom a0 :. Atom Int) :. Atom Int) :. Atom Int))
|
| 7 | 7 | -> Exp
|
| 8 | 8 | (Plain (((Unlifted (Atom a0) :. Exp Int) :. Exp Int) :. Exp Int))
|
| 9 | - ‘k’ is a rigid type variable bound by
|
|
| 9 | + ‘n’ is a rigid type variable bound by
|
|
| 10 | 10 | the type signature for:
|
| 11 | 11 | test :: forall sh k m n.
|
| 12 | 12 | Shape (((sh :. k) :. m) :. n) -> Shape (((sh :. m) :. n) :. k)
|
| 1 | -RecordDotSyntaxFail10.hs:40:11: error: [GHC-18872]
|
|
| 2 | - • Couldn't match type ‘Int’ with ‘[Char]’
|
|
| 1 | +RecordDotSyntaxFail10.hs:40:11: error: [GHC-39999]
|
|
| 2 | + • No instance for ‘HasField "quux" Quux String’
|
|
| 3 | 3 | • In the second argument of ‘($)’, namely ‘a {foo.bar.baz.quux}’
|
| 4 | 4 | In a stmt of a 'do' block: print $ a {foo.bar.baz.quux}
|
| 5 | 5 | In the expression:
|
| 6 | 6 | do let a = Foo {foo = ...}
|
| 7 | - do let a = ...
|
|
| 8 | 7 | let quux = "Expecto patronum!"
|
| 9 | 8 | print $ a {foo.bar.baz.quux}
|
| 10 | 9 |
| 1 | -RecordDotSyntaxFail13.hs:26:11: error: [GHC-18872]
|
|
| 2 | - • Couldn't match type ‘Int’ with ‘Foo -> Int’
|
|
| 3 | - arising from a functional dependency between:
|
|
| 4 | - constraint ‘HasField "foo" Foo (Foo -> Int)’
|
|
| 5 | - arising from a record update
|
|
| 6 | - instance ‘HasField "foo" Foo Int’
|
|
| 7 | - at RecordDotSyntaxFail13.hs:21:10-31
|
|
| 1 | +RecordDotSyntaxFail13.hs:26:11: error: [GHC-39999]
|
|
| 2 | + • No instance for ‘HasField "foo" Foo (Foo -> Int)’
|
|
| 3 | + arising from a record update
|
|
| 4 | + (maybe you haven't applied a function to enough arguments?)
|
|
| 8 | 5 | • In the second argument of ‘($)’, namely ‘a {foo}’
|
| 9 | 6 | In a stmt of a 'do' block: print $ a {foo}
|
| 10 | 7 | In the expression:
|
| 11 | - do let a = ...
|
|
| 8 | + do let a = Foo {foo = 12}
|
|
| 12 | 9 | print $ a {foo}
|
| 13 | 10 |
| 1 | 1 | T14040a.hs:26:46: error: [GHC-46956]
|
| 2 | - • Couldn't match kind ‘k1’ with ‘WeirdList z’
|
|
| 3 | - Expected kind ‘WeirdList k1’,
|
|
| 2 | + • Couldn't match kind ‘k0’ with ‘WeirdList z’
|
|
| 3 | + Expected kind ‘WeirdList k0’,
|
|
| 4 | 4 | but ‘xs’ has kind ‘WeirdList (WeirdList z)’
|
| 5 | 5 | because kind variable ‘z’ would escape its scope
|
| 6 | 6 | This (rigid, skolem) kind variable is bound by
|
| ... | ... | @@ -24,8 +24,8 @@ T14040a.hs:26:46: error: [GHC-46956] |
| 24 | 24 | -> p _ wl
|
| 25 | 25 | |
| 26 | 26 | T14040a.hs:27:27: error: [GHC-46956]
|
| 27 | - • Couldn't match kind ‘k0’ with ‘z’
|
|
| 28 | - Expected kind ‘WeirdList k0’,
|
|
| 27 | + • Couldn't match kind ‘k1’ with ‘z’
|
|
| 28 | + Expected kind ‘WeirdList k1’,
|
|
| 29 | 29 | but ‘WeirdCons x xs’ has kind ‘WeirdList z’
|
| 30 | 30 | because kind variable ‘z’ would escape its scope
|
| 31 | 31 | This (rigid, skolem) kind variable is bound by
|
| ... | ... | @@ -8,6 +8,7 @@ RepPolyRightSection.hs:14:11: error: [GHC-55287] |
| 8 | 8 | • *
|
| 9 | 9 | Cannot unify ‘r’ with the type variable ‘q0’
|
| 10 | 10 | because the former is not a concrete ‘RuntimeRep’.
|
| 11 | - • In the expression: `g` undefined
|
|
| 11 | + • In the expression: g
|
|
| 12 | + In the expression: `g` undefined
|
|
| 12 | 13 | In an equation for ‘test2’: test2 = (`g` undefined)
|
| 13 | 14 |
| 1 | 1 | T14040.hs:27:46: error: [GHC-46956]
|
| 2 | - • Couldn't match kind ‘k1’ with ‘WeirdList z’
|
|
| 3 | - Expected kind ‘WeirdList k1’,
|
|
| 2 | + • Couldn't match kind ‘k0’ with ‘WeirdList z’
|
|
| 3 | + Expected kind ‘WeirdList k0’,
|
|
| 4 | 4 | but ‘xs’ has kind ‘WeirdList (WeirdList z)’
|
| 5 | 5 | because kind variable ‘z’ would escape its scope
|
| 6 | 6 | This (rigid, skolem) kind variable is bound by
|
| ... | ... | @@ -24,8 +24,8 @@ T14040.hs:27:46: error: [GHC-46956] |
| 24 | 24 | -> p _ wl
|
| 25 | 25 | |
| 26 | 26 | T14040.hs:28:27: error: [GHC-46956]
|
| 27 | - • Couldn't match kind ‘k0’ with ‘z’
|
|
| 28 | - Expected kind ‘WeirdList k0’,
|
|
| 27 | + • Couldn't match kind ‘k1’ with ‘z’
|
|
| 28 | + Expected kind ‘WeirdList k1’,
|
|
| 29 | 29 | but ‘WeirdCons x xs’ has kind ‘WeirdList z’
|
| 30 | 30 | because kind variable ‘z’ would escape its scope
|
| 31 | 31 | This (rigid, skolem) kind variable is bound by
|
| 1 | - |
|
| 2 | -T13651.hs:12:8: error: [GHC-25897]
|
|
| 3 | - • Could not deduce ‘cr ~ Bar h (Foo r)’
|
|
| 4 | - from the context: (F cr cu ~ Bar h (Bar r u),
|
|
| 5 | - F cu cs ~ Bar (Foo h) (Bar u s))
|
|
| 6 | - bound by the type signature for:
|
|
| 7 | - foo :: forall cr cu h r u cs s.
|
|
| 8 | - (F cr cu ~ Bar h (Bar r u), F cu cs ~ Bar (Foo h) (Bar u s)) =>
|
|
| 9 | - Bar h (Bar r u) -> Bar (Foo h) (Bar u s) -> Foo (cr -> cs)
|
|
| 10 | - at T13651.hs:(12,8)-(14,65)
|
|
| 11 | - ‘cr’ is a rigid type variable bound by
|
|
| 12 | - the type signature for:
|
|
| 13 | - foo :: forall cr cu h r u cs s.
|
|
| 14 | - (F cr cu ~ Bar h (Bar r u), F cu cs ~ Bar (Foo h) (Bar u s)) =>
|
|
| 15 | - Bar h (Bar r u) -> Bar (Foo h) (Bar u s) -> Foo (cr -> cs)
|
|
| 16 | - at T13651.hs:(12,8)-(14,65)
|
|
| 17 | - • In the ambiguity check for ‘foo’
|
|
| 18 | - To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
|
|
| 19 | - In the type signature:
|
|
| 20 | - foo :: (F cr cu ~ Bar h (Bar r u),
|
|
| 21 | - F cu cs ~ Bar (Foo h) (Bar u s)) =>
|
|
| 22 | - Bar h (Bar r u) -> Bar (Foo h) (Bar u s) -> Foo (cr -> cs) |
| ... | ... | @@ -586,7 +586,7 @@ test('T13594', normal, compile_fail, ['']) |
| 586 | 586 | test('T13603', normal, compile, [''])
|
| 587 | 587 | test('T13333', normal, compile, [''])
|
| 588 | 588 | test('T13585', [extra_files(['T13585.hs', 'T13585a.hs', 'T13585b.hs'])], makefile_test, [])
|
| 589 | -test('T13651', normal, compile_fail, [''])
|
|
| 589 | +test('T13651', normal, compile, [''])
|
|
| 590 | 590 | test('T13651a', normal, compile, [''])
|
| 591 | 591 | test('T13680', normal, compile, [''])
|
| 592 | 592 | test('T13785', normal, compile, [''])
|
| ... | ... | @@ -3,8 +3,8 @@ T8603.hs:33:17: error: [GHC-18872] |
| 3 | 3 | When matching types
|
| 4 | 4 | m0 :: * -> *
|
| 5 | 5 | [a2] :: *
|
| 6 | - Expected: [a2] -> StateT s RV a0
|
|
| 7 | - Actual: t0 m0 (StateT s RV a0)
|
|
| 6 | + Expected: [a2] -> StateT s RV a1
|
|
| 7 | + Actual: t0 m0 (StateT s RV a1)
|
|
| 8 | 8 | • The function ‘lift’ is applied to two visible arguments,
|
| 9 | 9 | but its type ‘(Control.Monad.Trans.Class.MonadTrans t, Monad m) =>
|
| 10 | 10 | m a -> t m a’
|