summaryrefslogtreecommitdiff
path: root/testsuite/tests/rep-poly/T17021.stderr
diff options
context:
space:
mode:
authorsheaf <sam.derbyshire@gmail.com>2022-03-02 00:12:17 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-03-02 14:08:36 -0500
commitb27b2af3fab48e21aabcc9441967c4dd7a6a75ea (patch)
treeca2919f3d98c35b6a22b08118ca32f4dae04a40d /testsuite/tests/rep-poly/T17021.stderr
parentaeea6bd588060108dea88996c19f48b9e50adad2 (diff)
downloadhaskell-b27b2af3fab48e21aabcc9441967c4dd7a6a75ea.tar.gz
Introduce ConcreteTv metavariables
This patch introduces a new kind of metavariable, by adding the constructor `ConcreteTv` to `MetaInfo`. A metavariable with `ConcreteTv` `MetaInfo`, henceforth a concrete metavariable, can only be unified with a type that is concrete (that is, a type that answers `True` to `GHC.Core.Type.isConcrete`). This solves the problem of dangling metavariables in `Concrete#` constraints: instead of emitting `Concrete# ty`, which contains a secret existential metavariable, we simply emit a primitive equality constraint `ty ~# concrete_tv` where `concrete_tv` is a fresh concrete metavariable. This means we can avoid all the complexity of canonicalising `Concrete#` constraints, as we can just re-use the existing machinery for `~#`. To finish things up, this patch then removes the `Concrete#` special predicate, and instead introduces the special predicate `IsRefl#` which enforces that a coercion is reflexive. Such a constraint is needed because the canonicaliser is quite happy to rewrite an equality constraint such as `ty ~# concrete_tv`, but such a rewriting is not handled by the rest of the compiler currently, as we need to make use of the resulting coercion, as outlined in the FixedRuntimeRep plan. The big upside of this approach (on top of simplifying the code) is that we can now selectively implement PHASE 2 of FixedRuntimeRep, by changing individual calls of `hasFixedRuntimeRep_MustBeRefl` to `hasFixedRuntimeRep` and making use of the obtained coercion.
Diffstat (limited to 'testsuite/tests/rep-poly/T17021.stderr')
-rw-r--r--testsuite/tests/rep-poly/T17021.stderr13
1 files changed, 13 insertions, 0 deletions
diff --git a/testsuite/tests/rep-poly/T17021.stderr b/testsuite/tests/rep-poly/T17021.stderr
new file mode 100644
index 0000000000..accd9c1560
--- /dev/null
+++ b/testsuite/tests/rep-poly/T17021.stderr
@@ -0,0 +1,13 @@
+
+T17021.hs:18:9: error:
+ • The function argument
+ ‘42’
+ does not have a fixed runtime representation.
+ Its type is:
+ Int :: TYPE (Id LiftedRep)
+ NB: GHC does not (yet) support rewriting in runtime representations.
+ Please comment on GHC ticket #13105 if this is causing you trouble.
+ <https://gitlab.haskell.org/ghc/ghc/-/issues/13105>
+ • In the first argument of ‘MkT’, namely ‘42’
+ In the expression: MkT 42
+ In an equation for ‘f’: f = MkT 42