diff options
author | sheaf <sam.derbyshire@gmail.com> | 2022-04-01 17:17:58 +0200 |
---|---|---|
committer | Jakob Bruenker <jakob.bruenker@gmail.com> | 2022-04-01 20:36:01 +0200 |
commit | aefb1e6d15749dd318e98a326d9df34b26c38cbd (patch) | |
tree | 8ccd34cc9c9fb1bff5697c3a945be44aecde3ee0 /testsuite | |
parent | 9a325b59aeba2b52af1ab9e4ca0b1a8aafc82a54 (diff) | |
download | haskell-aefb1e6d15749dd318e98a326d9df34b26c38cbd.tar.gz |
Ensure implicit parameters are lifted
`tcExpr` typechecked implicit parameters by introducing a metavariable
of kind `TYPE kappa`, without enforcing that `kappa ~ LiftedRep`.
This patch instead creates a metavariable of kind `Type`.
Fixes #21327
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/tests/typecheck/should_fail/T21327.hs | 7 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_fail/T21327.stderr | 8 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_fail/all.T | 1 |
3 files changed, 16 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_fail/T21327.hs b/testsuite/tests/typecheck/should_fail/T21327.hs new file mode 100644 index 0000000000..0f0fcc9e01 --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/T21327.hs @@ -0,0 +1,7 @@ +{-# LANGUAGE ImplicitParams, MagicHash #-} + +module T21327 where + +import GHC.Exts + +foo () = (?p :: Int#) diff --git a/testsuite/tests/typecheck/should_fail/T21327.stderr b/testsuite/tests/typecheck/should_fail/T21327.stderr new file mode 100644 index 0000000000..3756d2e3ae --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/T21327.stderr @@ -0,0 +1,8 @@ + +T21327.hs:7:11: + Couldn't match a lifted type with an unlifted type + When matching types + t0 :: * + Int# :: TYPE 'IntRep + In the expression: ?p :: Int# + In an equation for ‘foo’: foo () = (?p :: Int#) diff --git a/testsuite/tests/typecheck/should_fail/all.T b/testsuite/tests/typecheck/should_fail/all.T index 939d9b156e..af529398f3 100644 --- a/testsuite/tests/typecheck/should_fail/all.T +++ b/testsuite/tests/typecheck/should_fail/all.T @@ -652,3 +652,4 @@ test('AmbigFDs', normal, compile_fail, ['']) test('T20064', normal, compile_fail, ['']) test('T21130', normal, compile_fail, ['']) test('T20768_fail', normal, compile_fail, ['']) +test('T21327', normal, compile_fail, ['']) |