Simon Peyton Jones pushed to branch wip/T26868 at Glasgow Haskell Compiler / GHC Commits: 7c714caf by Simon Peyton Jones at 2026-02-28T23:47:11+00:00 Wibble error messages - - - - - 15 changed files: - compiler/GHC/Core/Predicate.hs - compiler/GHC/Tc/Errors.hs - testsuite/tests/count-deps/CountDepsAst.stdout - testsuite/tests/count-deps/CountDepsParser.stdout - testsuite/tests/cpranal/should_compile/T18401.stderr - testsuite/tests/deriving/should_fail/deriving-via-fail4.stderr - testsuite/tests/indexed-types/should_fail/T2693.stderr - testsuite/tests/partial-sigs/should_compile/T10403.stderr - testsuite/tests/partial-sigs/should_compile/T12844.stderr - testsuite/tests/partial-sigs/should_compile/T15039a.stderr - testsuite/tests/partial-sigs/should_compile/T15039b.stderr - testsuite/tests/partial-sigs/should_compile/T15039c.stderr - testsuite/tests/partial-sigs/should_compile/T15039d.stderr - testsuite/tests/partial-sigs/should_fail/T10999.stderr - testsuite/tests/partial-sigs/should_fail/T12634.stderr Changes: ===================================== compiler/GHC/Core/Predicate.hs ===================================== @@ -749,7 +749,12 @@ tyCoVarsOfTypeWellScoped = scopedSort . tyCoVarsOfTypeList -- | Get the free vars of types in scoped order tyCoVarsOfTypesWellScoped :: [Type] -> [TyVar] -tyCoVarsOfTypesWellScoped = scopedSort . tyCoVarsOfTypesList +tyCoVarsOfTypesWellScoped tys +-- = pprTrace "tyCoVarsOfTypesWellScoped" +-- (vcat [ ppr tys +-- , ppr (tyCoVarsOfTypesList tys) +-- , ppr (scopedSort (tyCoVarsOfTypesList tys)) ]) $ + = scopedSort (tyCoVarsOfTypesList tys) {- ********************************************************************* ===================================== compiler/GHC/Tc/Errors.hs ===================================== @@ -2024,6 +2024,12 @@ mkTyVarEqErr' ctxt item tv1 ty2 { mismatchMsg = headline_msg , cannotUnifyReason = occurs_err } +-- pprTrace "mkTyVarEqErr" (vcat +-- [ text "interesting" <+> pprTyVars interesting_tyvars +-- , text "tv1" <+> ppr tv1 +-- , text "free tvs1" <+> pprTyVars (tyCoVarsOfTypeList ty1) +-- , text "ty2" <+> ppr ty2 +-- , text "free tvs2" <+> pprTyVars (tyCoVarsOfTypeList ty2) ]) $ return main_msg -- If the immediately-enclosing implication has 'tv' a skolem, and ===================================== testsuite/tests/count-deps/CountDepsAst.stdout ===================================== @@ -192,6 +192,7 @@ GHC.Types.Unique.Set GHC.Types.Unique.Supply GHC.Types.Var GHC.Types.Var.Env +GHC.Types.Var.FV GHC.Types.Var.Set GHC.Unit GHC.Unit.Home @@ -218,7 +219,6 @@ GHC.Utils.Containers.Internal.StrictPair GHC.Utils.EndoOS GHC.Utils.Error GHC.Utils.Exception -GHC.Utils.FV GHC.Utils.Fingerprint GHC.Utils.GlobalVars GHC.Utils.IO.Unsafe ===================================== testsuite/tests/count-deps/CountDepsParser.stdout ===================================== @@ -217,6 +217,7 @@ GHC.Types.Unique.Set GHC.Types.Unique.Supply GHC.Types.Var GHC.Types.Var.Env +GHC.Types.Var.FV GHC.Types.Var.Set GHC.Unit GHC.Unit.Home @@ -247,7 +248,6 @@ GHC.Utils.Containers.Internal.StrictPair GHC.Utils.EndoOS GHC.Utils.Error GHC.Utils.Exception -GHC.Utils.FV GHC.Utils.Fingerprint GHC.Utils.GlobalVars GHC.Utils.IO.Unsafe ===================================== testsuite/tests/cpranal/should_compile/T18401.stderr ===================================== @@ -1,37 +1,34 @@ ==================== Tidy Core ==================== -Result size of Tidy Core = {terms: 58, types: 93, coercions: 0, joins: 1/1} +Result size of Tidy Core = {terms: 52, types: 86, coercions: 0, joins: 0/0} Rec { -- RHS size: {terms: 18, types: 24, coercions: 0, joins: 0/0} -T18401.$w$spoly_$wgo1 :: forall a. a -> [a] -> (# [a] #) +T18401.$w$spoly_$wgo1 :: forall a. [a] -> a -> (# [a] #) T18401.$w$spoly_$wgo1 - = \ (@a_s1eu) (sc_s1ev :: a_s1eu) (sc1_s1ew :: [a_s1eu]) -> - case sc1_s1ew of { - [] -> (# GHC.Types.[] @a_s1eu #); - : y_a1dy ys_a1dz -> (# GHC.Types.: @a_s1eu sc_s1ev (case T18401.$w$spoly_$wgo1 @a_s1eu y_a1dy ys_a1dz of { (# ww_s1eA #) -> ww_s1eA }) #) + = \ (@a_s1fk) (sc_s1fl :: [a_s1fk]) (sc1_s1fm :: a_s1fk) -> + case sc_s1fl of { + [] -> (# GHC.Internal.Types.[] @a_s1fk #); + : y_a1eg ys_a1eh -> (# GHC.Internal.Types.: @a_s1fk sc1_s1fm (case T18401.$w$spoly_$wgo1 @a_s1fk ys_a1eh y_a1eg of { (# ww_s1fr #) -> ww_s1fr }) #) } end Rec } --- RHS size: {terms: 23, types: 29, coercions: 0, joins: 1/1} +-- RHS size: {terms: 17, types: 22, coercions: 0, joins: 0/0} si :: forall a. [a] -> (Bool, [a]) si - = \ (@a_s1dI) (xs0_s1dJ :: [a_s1dI]) -> - join { - $j_s1eq :: Bool %1 -> [a_s1dI] %1 -> (Bool, [a_s1dI]) - $j_s1eq (ww_s1dX :: Bool) (ww1_s1dY :: [a_s1dI]) = (ww_s1dX, ww1_s1dY) } in - case xs0_s1dJ of { - [] -> jump $j_s1eq GHC.Types.False (GHC.Types.[] @a_s1dI); - : y_a1dy ys_a1dz -> jump $j_s1eq GHC.Types.True (case T18401.$w$spoly_$wgo1 @a_s1dI y_a1dy ys_a1dz of { (# ww_s1eA #) -> ww_s1eA }) + = \ (@a_s1er) (xs0_s1es :: [a_s1er]) -> + case xs0_s1es of { + [] -> (GHC.Internal.Types.False, GHC.Internal.Types.[] @a_s1er); + : y_a1eg ys_a1eh -> (GHC.Internal.Types.True, case T18401.$w$spoly_$wgo1 @a_s1er ys_a1eh y_a1eg of { (# ww_s1fr #) -> ww_s1fr }) } -- RHS size: {terms: 14, types: 19, coercions: 0, joins: 0/0} safeInit :: forall a. [a] -> Maybe [a] safeInit - = \ (@a_aQY) (xs_awU :: [a_aQY]) -> - case xs_awU of { - [] -> GHC.Internal.Maybe.Nothing @[a_aQY]; - : y_a1dy ys_a1dz -> GHC.Internal.Maybe.Just @[a_aQY] (case T18401.$w$spoly_$wgo1 @a_aQY y_a1dy ys_a1dz of { (# ww_s1eA #) -> ww_s1eA }) + = \ (@a_aUv) (xs_ax5 :: [a_aUv]) -> + case xs_ax5 of { + [] -> GHC.Internal.Maybe.Nothing @[a_aUv]; + : y_a1eg ys_a1eh -> GHC.Internal.Maybe.Just @[a_aUv] (case T18401.$w$spoly_$wgo1 @a_aUv ys_a1eh y_a1eg of { (# ww_s1fr #) -> ww_s1fr }) } ===================================== testsuite/tests/deriving/should_fail/deriving-via-fail4.stderr ===================================== @@ -5,13 +5,13 @@ deriving-via-fail4.hs:15:12: error: [GHC-18872] • When deriving the instance for (Eq F1) deriving-via-fail4.hs:18:13: error: [GHC-25897] - • Couldn't match representation of type ‘a2’ with that of ‘a1’ + • Couldn't match representation of type ‘a1’ with that of ‘a2’ arising from the coercion of the method ‘c’ from type ‘a -> a -> Bool’ to type ‘a -> F2 a1 -> Bool’ - ‘a2’ is a rigid type variable bound by + ‘a1’ is a rigid type variable bound by the deriving clause for ‘C a (F2 a1)’ at deriving-via-fail4.hs:18:13-15 - ‘a1’ is a rigid type variable bound by + ‘a2’ is a rigid type variable bound by the deriving clause for ‘C a (F2 a1)’ at deriving-via-fail4.hs:18:13-15 • When deriving the instance for (C a (F2 a1)) ===================================== testsuite/tests/indexed-types/should_fail/T2693.stderr ===================================== @@ -1,38 +1,38 @@ T2693.hs:12:15: error: [GHC-83865] - • Couldn't match expected type: (a8, b1) + • Couldn't match expected type: (a7, b1) with actual type: TFn a6 The type variable ‘a6’ is ambiguous • In the first argument of ‘fst’, namely ‘x’ In the first argument of ‘(+)’, namely ‘fst x’ In the expression: fst x + fst x - • Relevant bindings include n :: a8 (bound at T2693.hs:12:7) + • Relevant bindings include n :: a7 (bound at T2693.hs:12:7) T2693.hs:12:23: error: [GHC-83865] - • Couldn't match expected type: (a8, b2) - with actual type: TFn a7 - The type variable ‘a7’ is ambiguous + • Couldn't match expected type: (a7, b2) + with actual type: TFn a8 + The type variable ‘a8’ is ambiguous • In the first argument of ‘fst’, namely ‘x’ In the second argument of ‘(+)’, namely ‘fst x’ In the expression: fst x + fst x - • Relevant bindings include n :: a8 (bound at T2693.hs:12:7) + • Relevant bindings include n :: a7 (bound at T2693.hs:12:7) T2693.hs:19:15: error: [GHC-83865] - • Couldn't match expected type: (a5, b0) + • Couldn't match expected type: (a3, b0) with actual type: TFn a2 The type variable ‘a2’ is ambiguous • In the first argument of ‘fst’, namely ‘x’ In the first argument of ‘(+)’, namely ‘fst x’ In the expression: fst x + snd x - • Relevant bindings include n :: a5 (bound at T2693.hs:19:7) + • Relevant bindings include n :: a3 (bound at T2693.hs:19:7) T2693.hs:19:23: error: [GHC-83865] - • Couldn't match expected type: (a4, a5) - with actual type: TFn a3 - The type variable ‘a3’ is ambiguous + • Couldn't match expected type: (a5, a3) + with actual type: TFn a4 + The type variable ‘a4’ is ambiguous • In the first argument of ‘snd’, namely ‘x’ In the second argument of ‘(+)’, namely ‘snd x’ In the expression: fst x + snd x - • Relevant bindings include n :: a5 (bound at T2693.hs:19:7) + • Relevant bindings include n :: a3 (bound at T2693.hs:19:7) T2693.hs:29:20: error: [GHC-83865] • Couldn't match type: TFn a0 ===================================== testsuite/tests/partial-sigs/should_compile/T10403.stderr ===================================== @@ -7,14 +7,14 @@ T10403.hs:16:7: warning: [GHC-88464] [-Wpartial-type-signatures (in -Wdefault)] T10403.hs:16:12: warning: [GHC-88464] [-Wpartial-type-signatures (in -Wdefault)] • Found type wildcard ‘_’ standing for ‘(t -> b) -> f t -> H f’ - Where: ‘b’, ‘t’, ‘f’ are rigid type variables bound by + Where: ‘t’, ‘b’, ‘f’ are rigid type variables bound by the inferred type of h1 :: Functor f => (t -> b) -> f t -> H f at T10403.hs:18:1-41 • In the type signature: h1 :: _ => _ T10403.hs:20:7: warning: [GHC-88464] [-Wpartial-type-signatures (in -Wdefault)] • Found type wildcard ‘_’ standing for ‘(t -> b) -> f t -> H f’ - Where: ‘b’, ‘t’, ‘f’ are rigid type variables bound by + Where: ‘t’, ‘b’, ‘f’ are rigid type variables bound by the inferred type of h2 :: (t -> b) -> f t -> H f at T10403.hs:23:1-41 • In the type signature: h2 :: _ ===================================== testsuite/tests/partial-sigs/should_compile/T12844.stderr ===================================== @@ -1,10 +1,10 @@ - T12844.hs:12:9: warning: [GHC-88464] [-Wpartial-type-signatures (in -Wdefault)] • Found extra-constraints wildcard standing for ‘(Head rngs ~ '(r, r'), Foo rngs)’ - Where: ‘r’, ‘r'’, ‘k1’, ‘k2’, ‘rngs’ + Where: ‘k1’, ‘k2’, ‘rngs’, ‘r’, ‘r'’ are rigid type variables bound by the inferred type of bar :: (Head rngs ~ '(r, r'), Foo rngs) => FooData rngs at T12844.hs:(12,1)-(13,9) • In the type signature: bar :: _ => FooData rngs + ===================================== testsuite/tests/partial-sigs/should_compile/T15039a.stderr ===================================== @@ -1,4 +1,3 @@ - T15039a.hs:19:14: warning: [GHC-88464] [-Wpartial-type-signatures (in -Wdefault)] • Found type wildcard ‘_’ standing for ‘Dict (a ~ b)’ Where: ‘a’, ‘b’ are rigid type variables bound by @@ -25,7 +24,7 @@ T15039a.hs:22:14: warning: [GHC-88464] [-Wpartial-type-signatures (in -Wdefault) T15039a.hs:25:14: warning: [GHC-88464] [-Wpartial-type-signatures (in -Wdefault)] • Found type wildcard ‘_’ standing for ‘Dict (a ~~ b)’ - Where: ‘a’, ‘k’, ‘b’ are rigid type variables bound by + Where: ‘k’, ‘a’, ‘b’ are rigid type variables bound by the type signature for: ex3 :: forall a k (b :: k). Dict (a ~~ b) -> () at T15039a.hs:24:1-43 @@ -54,3 +53,4 @@ T15039a.hs:35:8: warning: [GHC-88464] [-Wpartial-type-signatures (in -Wdefault)] at T15039a.hs:35:1-44 • In the type signature: ex7 :: _ => Coercion (a :: Type) (b :: Type) + ===================================== testsuite/tests/partial-sigs/should_compile/T15039b.stderr ===================================== @@ -1,4 +1,3 @@ - T15039b.hs:19:14: warning: [GHC-88464] [-Wpartial-type-signatures (in -Wdefault)] • Found type wildcard ‘_’ standing for ‘Dict ((a :: *) ~ (b :: *))’ Where: ‘a’, ‘b’ are rigid type variables bound by @@ -26,7 +25,7 @@ T15039b.hs:22:14: warning: [GHC-88464] [-Wpartial-type-signatures (in -Wdefault) T15039b.hs:25:14: warning: [GHC-88464] [-Wpartial-type-signatures (in -Wdefault)] • Found type wildcard ‘_’ standing for ‘Dict ((a :: *) ~~ (b :: k))’ - Where: ‘a’, ‘k’, ‘b’ are rigid type variables bound by + Where: ‘k’, ‘a’, ‘b’ are rigid type variables bound by the type signature for: ex3 :: forall a k (b :: k). Dict ((a :: *) ~~ (b :: k)) -> () at T15039b.hs:24:1-43 @@ -56,3 +55,4 @@ T15039b.hs:35:8: warning: [GHC-88464] [-Wpartial-type-signatures (in -Wdefault)] at T15039b.hs:35:1-44 • In the type signature: ex7 :: _ => Coercion (a :: Type) (b :: Type) + ===================================== testsuite/tests/partial-sigs/should_compile/T15039c.stderr ===================================== @@ -1,4 +1,3 @@ - T15039c.hs:19:14: warning: [GHC-88464] [-Wpartial-type-signatures (in -Wdefault)] • Found type wildcard ‘_’ standing for ‘Dict (a ~ b)’ Where: ‘a’, ‘b’ are rigid type variables bound by @@ -25,7 +24,7 @@ T15039c.hs:22:14: warning: [GHC-88464] [-Wpartial-type-signatures (in -Wdefault) T15039c.hs:25:14: warning: [GHC-88464] [-Wpartial-type-signatures (in -Wdefault)] • Found type wildcard ‘_’ standing for ‘Dict (a ~~ b)’ - Where: ‘a’, ‘k’, ‘b’ are rigid type variables bound by + Where: ‘k’, ‘a’, ‘b’ are rigid type variables bound by the type signature for: ex3 :: forall a k (b :: k). Dict (a ~~ b) -> () at T15039c.hs:24:1-43 @@ -54,3 +53,4 @@ T15039c.hs:35:8: warning: [GHC-88464] [-Wpartial-type-signatures (in -Wdefault)] at T15039c.hs:35:1-44 • In the type signature: ex7 :: _ => Coercion (a :: Type) (b :: Type) + ===================================== testsuite/tests/partial-sigs/should_compile/T15039d.stderr ===================================== @@ -1,4 +1,3 @@ - T15039d.hs:19:14: warning: [GHC-88464] [-Wpartial-type-signatures (in -Wdefault)] • Found type wildcard ‘_’ standing for ‘Dict ((a :: *) ~ (b :: *))’ Where: ‘a’, ‘b’ are rigid type variables bound by @@ -27,7 +26,7 @@ T15039d.hs:22:14: warning: [GHC-88464] [-Wpartial-type-signatures (in -Wdefault) T15039d.hs:25:14: warning: [GHC-88464] [-Wpartial-type-signatures (in -Wdefault)] • Found type wildcard ‘_’ standing for ‘Dict ((a :: *) ~~ (b :: k))’ - Where: ‘a’, ‘k’, ‘b’ are rigid type variables bound by + Where: ‘k’, ‘a’, ‘b’ are rigid type variables bound by the type signature for: ex3 :: forall a k (b :: k). Dict ((a :: *) ~~ (b :: k)) -> () at T15039d.hs:24:1-43 @@ -57,3 +56,4 @@ T15039d.hs:35:8: warning: [GHC-88464] [-Wpartial-type-signatures (in -Wdefault)] at T15039d.hs:35:1-44 • In the type signature: ex7 :: _ => Coercion (a :: Type) (b :: Type) + ===================================== testsuite/tests/partial-sigs/should_fail/T10999.stderr ===================================== @@ -15,10 +15,10 @@ T10999.hs:5:17: error: [GHC-88464] • In the type signature: f :: _ => () -> _ T10999.hs:8:28: error: [GHC-39999] - • Ambiguous type variable ‘b1’ arising from a use of ‘f’ - prevents the constraint ‘(Ord b1)’ from being solved. - Relevant bindings include g :: [b1] (bound at T10999.hs:8:1) - Probable fix: use a type annotation to specify what ‘b1’ should be. + • Ambiguous type variable ‘b0’ arising from a use of ‘f’ + prevents the constraint ‘(Ord b0)’ from being solved. + Relevant bindings include g :: [b0] (bound at T10999.hs:8:1) + Probable fix: use a type annotation to specify what ‘b0’ should be. Potentially matching instances: instance Ord a => Ord (Set.Intersection a) -- Defined in ‘Data.Set.Internal’ ===================================== testsuite/tests/partial-sigs/should_fail/T12634.stderr ===================================== @@ -1,9 +1,9 @@ - T12634.hs:15:58: error: [GHC-83865] • Expected a type, but ‘'(t, m, m', r)’ has kind - ‘(k1 -> k2 -> *, k0, k1, k2)’ + ‘(k0 -> k1 -> *, k2, k0, k1)’ • In the first argument of ‘Bench’, namely ‘'(t, m, m', r)’ In the type signature: bench_twacePow :: forall t m m' r. _ => t m' r -> Bench '(t, m, m', r) + View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/7c714cafd41c42f19debb2fca76667b5... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/7c714cafd41c42f19debb2fca76667b5... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Simon Peyton Jones (@simonpj)