[Git][ghc/ghc][wip/T24938] Wibbles

Simon Peyton Jones (@simonpj) gitlab at gitlab.haskell.org
Thu Jun 13 10:02:17 UTC 2024



Simon Peyton Jones pushed to branch wip/T24938 at Glasgow Haskell Compiler / GHC


Commits:
046e255d by Simon Peyton Jones at 2024-06-13T11:02:03+01:00
Wibbles

- - - - -


9 changed files:

- testsuite/tests/indexed-types/should_fail/T13784.stderr
- testsuite/tests/linters/notes.stdout
- testsuite/tests/patsyn/should_fail/T11010.stderr
- testsuite/tests/typecheck/should_compile/LocalGivenEqs2.hs
- testsuite/tests/typecheck/should_compile/LocalGivenEqs2.stderr
- testsuite/tests/typecheck/should_compile/T24938a.hs
- testsuite/tests/typecheck/should_compile/all.T
- testsuite/tests/typecheck/should_fail/T22645.stderr
- testsuite/tests/typecheck/should_fail/T24938.stderr


Changes:

=====================================
testsuite/tests/indexed-types/should_fail/T13784.stderr
=====================================
@@ -1,6 +1,10 @@
-
 T13784.hs:29:28: error: [GHC-25897]
-    • Couldn't match type ‘as’ with ‘a : Divide a as’
+    • Could not deduce ‘as ~ (a : Divide a as)’
+      from the context: (a : as) ~ (a1 : as1)
+        bound by a pattern with constructor:
+                   :* :: forall a (as :: [*]). a -> Product as -> Product (a : as),
+                 in an equation for ‘divide’
+        at T13784.hs:29:13-19
       Expected: Product (Divide a (a : as))
         Actual: Product as1
       ‘as’ is a rigid type variable bound by
@@ -36,3 +40,4 @@ T13784.hs:33:29: error: [GHC-83865]
     • Relevant bindings include
         divide :: Product (a : as) -> (b, Product (Divide b (a : as)))
           (bound at T13784.hs:33:5)
+


=====================================
testsuite/tests/linters/notes.stdout
=====================================
@@ -1,39 +1,39 @@
 ref    compiler/GHC/Core/Coercion/Axiom.hs:472:2:     Note [RoughMap and rm_empty]
 ref    compiler/GHC/Core/Opt/OccurAnal.hs:1157:7:     Note [Loop breaking]
-ref    compiler/GHC/Core/Opt/SetLevels.hs:1586:30:     Note [Top level scope]
-ref    compiler/GHC/Core/Opt/Simplify/Iteration.hs:2832:13:     Note [Case binder next]
-ref    compiler/GHC/Core/Opt/Simplify/Iteration.hs:4023:8:     Note [Lambda-bound unfoldings]
-ref    compiler/GHC/Core/Opt/Simplify/Utils.hs:1342:37:     Note [Gentle mode]
+ref    compiler/GHC/Core/Opt/SetLevels.hs:1688:30:     Note [Top level scope]
+ref    compiler/GHC/Core/Opt/Simplify/Iteration.hs:2937:13:     Note [Case binder next]
+ref    compiler/GHC/Core/Opt/Simplify/Iteration.hs:4253:8:     Note [Lambda-bound unfoldings]
+ref    compiler/GHC/Core/Opt/Simplify/Utils.hs:1406:37:     Note [Gentle mode]
 ref    compiler/GHC/Core/Opt/Specialise.hs:1763:29:     Note [Arity decrease]
-ref    compiler/GHC/Core/TyCo/Rep.hs:1652:31:     Note [What prevents a constraint from floating]
-ref    compiler/GHC/Driver/DynFlags.hs:1251:52:     Note [Eta-reduction in -O0]
-ref    compiler/GHC/Driver/Main.hs:1749:34:     Note [simpleTidyPgm - mkBootModDetailsTc]
-ref    compiler/GHC/Hs/Expr.hs:191:63:     Note [Pending Splices]
-ref    compiler/GHC/Hs/Expr.hs:1727:87:     Note [Lifecycle of a splice]
-ref    compiler/GHC/Hs/Expr.hs:1763:7:     Note [Pending Splices]
-ref    compiler/GHC/Hs/Extension.hs:147:5:     Note [Strict argument type constraints]
-ref    compiler/GHC/Hs/Pat.hs:141:74:     Note [Lifecycle of a splice]
+ref    compiler/GHC/Core/TyCo/Rep.hs:1677:31:     Note [What prevents a constraint from floating]
+ref    compiler/GHC/Driver/DynFlags.hs:1225:52:     Note [Eta-reduction in -O0]
+ref    compiler/GHC/Driver/Main.hs:1751:34:     Note [simpleTidyPgm - mkBootModDetailsTc]
+ref    compiler/GHC/Hs/Expr.hs:192:63:     Note [Pending Splices]
+ref    compiler/GHC/Hs/Expr.hs:1955:87:     Note [Lifecycle of a splice]
+ref    compiler/GHC/Hs/Expr.hs:1991:7:     Note [Pending Splices]
+ref    compiler/GHC/Hs/Extension.hs:144:5:     Note [Strict argument type constraints]
+ref    compiler/GHC/Hs/Pat.hs:152:74:     Note [Lifecycle of a splice]
 ref    compiler/GHC/HsToCore/Pmc/Solver.hs:856:20:     Note [COMPLETE sets on data families]
-ref    compiler/GHC/HsToCore/Quote.hs:1487:7:     Note [How brackets and nested splices are handled]
-ref    compiler/GHC/Stg/Unarise.hs:438:32:     Note [Renaming during unarisation]
-ref    compiler/GHC/Tc/Gen/HsType.hs:556:56:     Note [Skolem escape prevention]
-ref    compiler/GHC/Tc/Gen/HsType.hs:2676:7:     Note [Matching a kind signature with a declaration]
-ref    compiler/GHC/Tc/Gen/Pat.hs:174:20:     Note [Typing patterns in pattern bindings]
-ref    compiler/GHC/Tc/Gen/Pat.hs:1163:7:     Note [Matching polytyped patterns]
-ref    compiler/GHC/Tc/Gen/Sig.hs:80:10:     Note [Overview of type signatures]
+ref    compiler/GHC/HsToCore/Quote.hs:1504:7:     Note [How brackets and nested splices are handled]
+ref    compiler/GHC/Stg/Unarise.hs:451:32:     Note [Renaming during unarisation]
+ref    compiler/GHC/Tc/Gen/HsType.hs:561:56:     Note [Skolem escape prevention]
+ref    compiler/GHC/Tc/Gen/HsType.hs:2707:7:     Note [Matching a kind signature with a declaration]
+ref    compiler/GHC/Tc/Gen/Pat.hs:286:20:     Note [Typing patterns in pattern bindings]
+ref    compiler/GHC/Tc/Gen/Pat.hs:1395:7:     Note [Matching polytyped patterns]
+ref    compiler/GHC/Tc/Gen/Sig.hs:77:10:     Note [Overview of type signatures]
 ref    compiler/GHC/Tc/Gen/Splice.hs:358:16:     Note [How brackets and nested splices are handled]
 ref    compiler/GHC/Tc/Gen/Splice.hs:533:35:     Note [PendingRnSplice]
-ref    compiler/GHC/Tc/Gen/Splice.hs:657:7:     Note [How brackets and nested splices are handled]
-ref    compiler/GHC/Tc/Gen/Splice.hs:891:11:     Note [How brackets and nested splices are handled]
+ref    compiler/GHC/Tc/Gen/Splice.hs:660:7:     Note [How brackets and nested splices are handled]
+ref    compiler/GHC/Tc/Gen/Splice.hs:904:11:     Note [How brackets and nested splices are handled]
 ref    compiler/GHC/Tc/Instance/Family.hs:406:35:     Note [Constrained family instances]
-ref    compiler/GHC/Tc/Solver/Rewrite.hs:1010:7:     Note [Stability of rewriting]
+ref    compiler/GHC/Tc/Solver/Rewrite.hs:1014:7:     Note [Stability of rewriting]
 ref    compiler/GHC/Tc/TyCl.hs:1316:6:     Note [Unification variables need fresh Names]
 ref    compiler/GHC/Tc/Types/Constraint.hs:206:38:     Note [NonCanonical Semantics]
-ref    compiler/GHC/Types/Demand.hs:301:25:     Note [Preserving Boxity of results is rarely a win]
+ref    compiler/GHC/Types/Demand.hs:303:25:     Note [Preserving Boxity of results is rarely a win]
 ref    compiler/GHC/Unit/Module/Deps.hs:83:13:     Note [Structure of dep_boot_mods]
 ref    compiler/GHC/Utils/Monad.hs:410:34:     Note [multiShotIO]
-ref    compiler/Language/Haskell/Syntax/Binds.hs:200:31:     Note [fun_id in Match]
-ref    configure.ac:203:10:     Note [Linking ghc-bin against threaded stage0 RTS]
+ref    compiler/Language/Haskell/Syntax/Binds.hs:220:31:     Note [fun_id in Match]
+ref    configure.ac:191:10:     Note [Linking ghc-bin against threaded stage0 RTS]
 ref    docs/core-spec/core-spec.mng:177:6:     Note [TyBinders]
 ref    hadrian/src/Expression.hs:145:30:     Note [Linking ghc-bin against threaded stage0 RTS]
 ref    linters/lint-notes/Notes.hs:32:29:     Note [" <> T.unpack x <> "]
@@ -43,26 +43,24 @@ ref    testsuite/tests/perf/should_run/all.T:8:6:     Note [Solving from instanc
 ref    testsuite/tests/polykinds/CuskFam.hs:16:11:     Note [Unifying implicit CUSK variables]
 ref    testsuite/tests/simplCore/should_compile/T5776.hs:16:7:     Note [Simplifying RULE lhs constraints]
 ref    testsuite/tests/simplCore/should_compile/simpl018.hs:3:7:     Note [Float coercions]
-ref    testsuite/tests/typecheck/should_compile/LocalGivenEqs.hs:7:7:     Note [When does an implication have given equalities?]
-ref    testsuite/tests/typecheck/should_compile/LocalGivenEqs2.hs:4:6:     Note [When does an implication have given equalities?]
 ref    testsuite/tests/typecheck/should_compile/T9117.hs:3:12:     Note [Order of Coercible Instances]
 ref    testsuite/tests/typecheck/should_compile/tc200.hs:5:7:     Note [Multiple instantiation]
 ref    testsuite/tests/typecheck/should_compile/tc228.hs:9:7:     Note [Inference and implication constraints]
 ref    testsuite/tests/typecheck/should_compile/tc231.hs:12:16:     Note [Important subtlety in oclose]
 ref    testsuite/tests/typecheck/should_fail/UnliftedNewtypesMultiFieldGadt.hs:11:28:     Note [Kind-checking the field type]
 ref    testsuite/tests/typecheck/should_fail/tcfail093.hs:13:7:     Note [Important subtlety in oclose]
-ref    utils/haddock/haddock-api/src/Haddock/Convert.hs<line>:<no>:     Note [Eta reduction for data family axioms]
-ref    utils/haddock/haddock-api/src/Haddock/Convert.hs<line>:<no>:     Note [Invariant: Never expand type synonyms]
-ref    utils/haddock/haddock-api/src/Haddock/Convert.hs<line>:<no>:     Note [Invariant: Never expand type synonyms]
-ref    utils/haddock/haddock-api/src/Haddock/Convert.hs<line>:<no>:     Note [Invariant: Never expand type synonyms]
-ref    utils/haddock/haddock-api/src/Haddock/Convert.hs<line>:<no>:     Note [Invariant: Never expand type synonyms]
-ref    utils/haddock/haddock-api/src/Haddock/Convert.hs<line>:<no>:     Note [Invariant: Never expand type synonyms]
-ref    utils/haddock/haddock-api/src/Haddock/Convert.hs<line>:<no>:     Note [Invariant: Never expand type synonyms]
-ref    utils/haddock/haddock-api/src/Haddock/Convert.hs<line>:<no>:     Note [Invariant: Never expand type synonyms]
-ref    utils/haddock/haddock-api/src/Haddock/Convert.hs<line>:<no>:     Note [Invariant: Never expand type synonyms]
-ref    utils/haddock/haddock-api/src/Haddock/Interface/Create.hs<line>:<no>:     Note [Exporting built-in items]
-ref    utils/haddock/haddock-api/src/Haddock/Interface/Create.hs<line>:<no>:     Note [Exporting built-in items]
-ref    utils/haddock/haddock-api/src/Haddock/Interface/Create.hs<line>:<no>:     Note [Exporting built-in items]
-ref    utils/haddock/haddock-api/src/Haddock/InterfaceFile.hs<line>:<no>:     Note [The DocModule story]
-ref    utils/haddock/haddock-api/src/Haddock/Types.hs<line>:<no>:     Note [Pass sensitive types]
+ref    utils/haddock/haddock-api/src/Haddock/Convert.hs:1068:13:     Note [Eta reduction for data family axioms]
+ref    utils/haddock/haddock-api/src/Haddock/Convert.hs:1085:0:     Note [Invariant: Never expand type synonyms]
+ref    utils/haddock/haddock-api/src/Haddock/Convert.hs:1101:7:     Note [Invariant: Never expand type synonyms]
+ref    utils/haddock/haddock-api/src/Haddock/Convert.hs:1108:9:     Note [Invariant: Never expand type synonyms]
+ref    utils/haddock/haddock-api/src/Haddock/Convert.hs:1117:9:     Note [Invariant: Never expand type synonyms]
+ref    utils/haddock/haddock-api/src/Haddock/Convert.hs:1131:9:     Note [Invariant: Never expand type synonyms]
+ref    utils/haddock/haddock-api/src/Haddock/Convert.hs:1145:9:     Note [Invariant: Never expand type synonyms]
+ref    utils/haddock/haddock-api/src/Haddock/Convert.hs:1147:9:     Note [Invariant: Never expand type synonyms]
+ref    utils/haddock/haddock-api/src/Haddock/Convert.hs:1156:9:     Note [Invariant: Never expand type synonyms]
+ref    utils/haddock/haddock-api/src/Haddock/Interface/Create.hs:117:11:     Note [Exporting built-in items]
+ref    utils/haddock/haddock-api/src/Haddock/Interface/Create.hs:182:9:     Note [Exporting built-in items]
+ref    utils/haddock/haddock-api/src/Haddock/Interface/Create.hs:252:7:     Note [Exporting built-in items]
+ref    utils/haddock/haddock-api/src/Haddock/InterfaceFile.hs:118:3:     Note [The DocModule story]
+ref    utils/haddock/haddock-api/src/Haddock/Types.hs:17:3:     Note [Pass sensitive types]
 


=====================================
testsuite/tests/patsyn/should_fail/T11010.stderr
=====================================
@@ -1,6 +1,8 @@
-
 T11010.hs:9:34: error: [GHC-25897]
-    • Couldn't match type ‘a1’ with ‘Int’
+    • Could not deduce ‘a1 ~ Int’
+      from the context: a ~ Int
+        bound by the signature for pattern synonym ‘IntFun’
+        at T11010.hs:9:1-36
       Expected: a -> b
         Actual: a1 -> b
       ‘a1’ is a rigid type variable bound by
@@ -15,3 +17,4 @@ T11010.hs:9:34: error: [GHC-25897]
   |
 9 | pattern IntFun str f x = Fun str f x
   |                                  ^
+


=====================================
testsuite/tests/typecheck/should_compile/LocalGivenEqs2.hs
=====================================
@@ -1,9 +1,7 @@
 {-# LANGUAGE TypeFamilies, GADTSyntax, ExistentialQuantification #-}
 
--- This is a simple case that exercises the LocalGivenEqs bullet
--- of Note [Tracking Given equalities] in GHC.Tc.Solver.InertSet
--- If a future change rejects this, that's not the end of the world, but it's nice
--- to be able to infer `f`.
+-- This one should be rejected.
+-- See Note [Tracking Given equalities] in GHC.Tc.Solver.InertSet
 
 module LocalGivenEqs2 where
 


=====================================
testsuite/tests/typecheck/should_compile/LocalGivenEqs2.stderr
=====================================
@@ -1 +1,16 @@
- 
\ No newline at end of file
+LocalGivenEqs2.hs:14:15: error: [GHC-25897]
+    • Could not deduce ‘p ~ Bool’
+      from the context: F a ~ G b
+        bound by a pattern with constructor:
+                   MkT :: forall a b. (F a ~ G b) => a -> b -> T,
+                 in an equation for ‘f’
+        at LocalGivenEqs2.hs:14:4-10
+      ‘p’ is a rigid type variable bound by
+        the inferred type of f :: T -> p
+        at LocalGivenEqs2.hs:14:1-18
+    • In the expression: True
+      In an equation for ‘f’: f (MkT _ _) = True
+    • Relevant bindings include
+        f :: T -> p (bound at LocalGivenEqs2.hs:14:1)
+    Suggested fix: Consider giving ‘f’ a type signature
+


=====================================
testsuite/tests/typecheck/should_compile/T24938a.hs
=====================================
@@ -1,6 +1,6 @@
 {-# LANGUAGE TypeFamilies, GADTs #-}
 
-module Foo where
+module T24938a where
 
 type family F a
 


=====================================
testsuite/tests/typecheck/should_compile/all.T
=====================================
@@ -918,5 +918,5 @@ test('T23764', normal, compile, [''])
 test('T23739a', normal, compile, [''])
 test('T24810', normal, compile, [''])
 test('T24887', normal, compile, [''])
-test('T2938a', normal, compile, [''])
+test('T24938a', normal, compile, [''])
 


=====================================
testsuite/tests/typecheck/should_fail/T22645.stderr
=====================================
@@ -1,6 +1,9 @@
-
 T22645.hs:9:5: error: [GHC-25897]
-    • Couldn't match type ‘a’ with ‘b’ arising from a use of ‘coerce’
+    • Could not deduce ‘a ~ b’ arising from a use of ‘coerce’
+      from the context: Coercible a b
+        bound by the type signature for:
+                   p :: forall a b. Coercible a b => T Maybe a -> T Maybe b
+        at T22645.hs:8:1-44
       ‘a’ is a rigid type variable bound by
         the type signature for:
           p :: forall a b. Coercible a b => T Maybe a -> T Maybe b
@@ -13,3 +16,4 @@ T22645.hs:9:5: error: [GHC-25897]
       In an equation for ‘p’: p = coerce
     • Relevant bindings include
         p :: T Maybe a -> T Maybe b (bound at T22645.hs:9:1)
+


=====================================
testsuite/tests/typecheck/should_fail/T24938.stderr
=====================================
@@ -1 +1,19 @@
- 
\ No newline at end of file
+T24938.hs:30:16: error: [GHC-25897]
+    • Could not deduce ‘p ~ GHC.Types.Bool’
+      from the context: Nt String ~ Mt Int
+        bound by a pattern with constructor:
+                   Refl :: forall {k} (a :: k). Eq a a,
+                 in a case alternative
+        at T24938.hs:28:5-8
+      ‘p’ is a rigid type variable bound by
+        the inferred type of foo :: p -> Eq (Mt Int) (Nt String) -> t
+        at T24938.hs:(26,1)-(33,17)
+    • In the expression: p
+      In the expression: if p then useIntAndRaise x else use x
+      In an equation for ‘bar’:
+          bar x = if p then useIntAndRaise x else use x
+    • Relevant bindings include
+        p :: p (bound at T24938.hs:26:5)
+        foo :: p -> Eq (Mt Int) (Nt String) -> t (bound at T24938.hs:26:1)
+    Suggested fix: Consider giving ‘foo’ a type signature
+



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/046e255d023c2954d475d14d19c784a9a76341a7

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/046e255d023c2954d475d14d19c784a9a76341a7
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20240613/c1466bc7/attachment-0001.html>


More information about the ghc-commits mailing list