summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_fail/T16646Fail2.stderr
diff options
context:
space:
mode:
authorKrzysztof Gogolewski <krzysztof.gogolewski@tweag.io>2022-05-14 01:07:36 +0200
committerKrzysztof Gogolewski <krzysztof.gogolewski@tweag.io>2022-05-27 16:44:48 +0200
commit3bd7d5d668b316f517a66c72fcf9bc7a36cc6ba4 (patch)
tree186c133c0259d87f04b79c2017b7ee858b1b380a /testsuite/tests/typecheck/should_fail/T16646Fail2.stderr
parented37027f713bb6563fd98d144a39211339fd91a5 (diff)
downloadhaskell-3bd7d5d668b316f517a66c72fcf9bc7a36cc6ba4.tar.gz
Use a class to check validity of withDictwip/withdict
This moves handling of the magic 'withDict' function from the desugarer to the typechecker. Details in Note [withDict]. I've extracted a part of T16646Fail to a separate file T16646Fail2, because the new error in 'reify' hides the errors from 'f' and 'g'. WithDict now works with casts, this fixes #21328. Part of #19915
Diffstat (limited to 'testsuite/tests/typecheck/should_fail/T16646Fail2.stderr')
-rw-r--r--testsuite/tests/typecheck/should_fail/T16646Fail2.stderr16
1 files changed, 16 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_fail/T16646Fail2.stderr b/testsuite/tests/typecheck/should_fail/T16646Fail2.stderr
new file mode 100644
index 0000000000..7a8178136c
--- /dev/null
+++ b/testsuite/tests/typecheck/should_fail/T16646Fail2.stderr
@@ -0,0 +1,16 @@
+
+T16646Fail2.hs:19:13: error:
+ • Couldn't match type: b0 -> a
+ with: forall (proxy :: * -> *). proxy Any -> a
+ arising from a use of ‘withDict’
+ • In the expression:
+ withDict @(Reifies (Any @Type) a) @_ (const a) (k @Any) Proxy
+ In an equation for ‘reify’:
+ reify a k
+ = withDict @(Reifies (Any @Type) a) @_ (const a) (k @Any) Proxy
+ • Relevant bindings include
+ k :: forall s. Reifies s a => Proxy s -> r
+ (bound at T16646Fail2.hs:19:9)
+ a :: a (bound at T16646Fail2.hs:19:7)
+ reify :: a -> (forall s. Reifies s a => Proxy s -> r) -> r
+ (bound at T16646Fail2.hs:19:1)