summaryrefslogtreecommitdiff
path: root/testsuite/tests
diff options
context:
space:
mode:
authorsheaf <sam.derbyshire@gmail.com>2023-03-31 15:03:11 +0200
committerKrzysztof Gogolewski <krzysztof.gogolewski@tweag.io>2023-04-15 15:14:36 +0200
commitbad2f8b8aa84241e523577062e2b69090efccb32 (patch)
treeb89b8b3a61ea5ba3f4f577e2d30ecbae53004d64 /testsuite/tests
parent0da18eb79540181ae9835e73d52ba47ec79fff6b (diff)
downloadhaskell-bad2f8b8aa84241e523577062e2b69090efccb32.tar.gz
Handle ConcreteTvs in inferResultToTypewip/T23153
inferResultToType was discarding the ir_frr information, which meant some metavariables ended up being MetaTvs instead of ConcreteTvs. This function now creates new ConcreteTvs as necessary, instead of always creating MetaTvs. Fixes #23154
Diffstat (limited to 'testsuite/tests')
-rw-r--r--testsuite/tests/rep-poly/RepPolyInferPatBind.stderr2
-rw-r--r--testsuite/tests/rep-poly/RepPolyInferPatSyn.stderr2
-rw-r--r--testsuite/tests/rep-poly/RepPolyPatBind.stderr16
-rw-r--r--testsuite/tests/rep-poly/T23154.hs7
-rw-r--r--testsuite/tests/rep-poly/T23154.stderr10
-rw-r--r--testsuite/tests/rep-poly/all.T1
-rw-r--r--testsuite/tests/typecheck/should_fail/VtaFail.stderr2
7 files changed, 37 insertions, 3 deletions
diff --git a/testsuite/tests/rep-poly/RepPolyInferPatBind.stderr b/testsuite/tests/rep-poly/RepPolyInferPatBind.stderr
index a9643f4b73..b85e0be15e 100644
--- a/testsuite/tests/rep-poly/RepPolyInferPatBind.stderr
+++ b/testsuite/tests/rep-poly/RepPolyInferPatBind.stderr
@@ -8,7 +8,7 @@ RepPolyInferPatBind.hs:21:2: error: [GHC-55287]
• The pattern binding does not have a fixed runtime representation.
Its type is:
T :: TYPE R
- Cannot unify ‘R’ with the type variable ‘p0’
+ Cannot unify ‘R’ with the type variable ‘c0’
because it is not a concrete ‘RuntimeRep’.
• When checking that the pattern signature: T
fits the type of its context: T
diff --git a/testsuite/tests/rep-poly/RepPolyInferPatSyn.stderr b/testsuite/tests/rep-poly/RepPolyInferPatSyn.stderr
index 4515832b21..a0eb6a6916 100644
--- a/testsuite/tests/rep-poly/RepPolyInferPatSyn.stderr
+++ b/testsuite/tests/rep-poly/RepPolyInferPatSyn.stderr
@@ -4,7 +4,7 @@ RepPolyInferPatSyn.hs:22:16: error: [GHC-55287]
does not have a fixed runtime representation.
Its type is:
T :: TYPE R
- Cannot unify ‘R’ with the type variable ‘p0’
+ Cannot unify ‘R’ with the type variable ‘c0’
because it is not a concrete ‘RuntimeRep’.
• When checking that the pattern signature: T
fits the type of its context: T
diff --git a/testsuite/tests/rep-poly/RepPolyPatBind.stderr b/testsuite/tests/rep-poly/RepPolyPatBind.stderr
index 40637215fe..fca59b9777 100644
--- a/testsuite/tests/rep-poly/RepPolyPatBind.stderr
+++ b/testsuite/tests/rep-poly/RepPolyPatBind.stderr
@@ -1,5 +1,21 @@
RepPolyPatBind.hs:18:5: error: [GHC-55287]
+ • The pattern binding does not have a fixed runtime representation.
+ Its type is:
+ p0 :: TYPE c0
+ Cannot unify ‘TupleRep [rep, rep]’ with the type variable ‘c0’
+ because it is not a concrete ‘RuntimeRep’.
+ • In the pattern: (# x, y #)
+ In a pattern binding: (# x, y #) = undefined
+ In the expression:
+ let
+ x, y :: a
+ (# x, y #) = undefined
+ in x
+ • Relevant bindings include
+ foo :: () -> a (bound at RepPolyPatBind.hs:15:1)
+
+RepPolyPatBind.hs:18:5: error: [GHC-55287]
• • The binder ‘y’ does not have a fixed runtime representation.
Its type is:
a :: TYPE rep
diff --git a/testsuite/tests/rep-poly/T23154.hs b/testsuite/tests/rep-poly/T23154.hs
new file mode 100644
index 0000000000..b0048e441f
--- /dev/null
+++ b/testsuite/tests/rep-poly/T23154.hs
@@ -0,0 +1,7 @@
+{-# LANGUAGE PartialTypeSignatures #-}
+
+module T23154 where
+
+import GHC.Exts
+
+f x = x :: (_ :: (TYPE (_ _)))
diff --git a/testsuite/tests/rep-poly/T23154.stderr b/testsuite/tests/rep-poly/T23154.stderr
new file mode 100644
index 0000000000..46d416a0d0
--- /dev/null
+++ b/testsuite/tests/rep-poly/T23154.stderr
@@ -0,0 +1,10 @@
+
+T23154.hs:7:1: error: [GHC-52083]
+ The first pattern in the equation for ‘f’
+ cannot be assigned a fixed runtime representation, not even by defaulting.
+ Suggested fix: Add a type signature.
+
+T23154.hs:7:1: error: [GHC-52083]
+ The first pattern in the equation for ‘f’
+ cannot be assigned a fixed runtime representation, not even by defaulting.
+ Suggested fix: Add a type signature.
diff --git a/testsuite/tests/rep-poly/all.T b/testsuite/tests/rep-poly/all.T
index a05a6bb7e5..0be5b954af 100644
--- a/testsuite/tests/rep-poly/all.T
+++ b/testsuite/tests/rep-poly/all.T
@@ -117,3 +117,4 @@ test('T21650_b', normal, compile_fail, ['-Wno-deprecated-flags']) ##
test('T23051', normal, compile_fail, [''])
test('T23153', normal, compile_fail, [''])
+test('T23154', normal, compile_fail, [''])
diff --git a/testsuite/tests/typecheck/should_fail/VtaFail.stderr b/testsuite/tests/typecheck/should_fail/VtaFail.stderr
index 4d01d8b8bb..925189c0fc 100644
--- a/testsuite/tests/typecheck/should_fail/VtaFail.stderr
+++ b/testsuite/tests/typecheck/should_fail/VtaFail.stderr
@@ -7,7 +7,7 @@ VtaFail.hs:7:16: error: [GHC-95781]
answer_nosig = pairup_nosig @Int @Bool 5 True
VtaFail.hs:14:17: error: [GHC-95781]
- • Cannot apply expression of type ‘p1 -> p1’
+ • Cannot apply expression of type ‘p0 -> p0’
to a visible type argument ‘Int’
• In the expression: (\ x -> x) @Int 12
In an equation for ‘answer_lambda’: