summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_fail/T3323.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/typecheck/should_fail/T3323.hs')
-rw-r--r--testsuite/tests/typecheck/should_fail/T3323.hs18
1 files changed, 18 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_fail/T3323.hs b/testsuite/tests/typecheck/should_fail/T3323.hs
new file mode 100644
index 0000000000..22ed520806
--- /dev/null
+++ b/testsuite/tests/typecheck/should_fail/T3323.hs
@@ -0,0 +1,18 @@
+-- Trac #3323
+module T3323 where
+
+import GHC.IO.Handle.Types
+import GHC.IO.Handle.Internals
+
+-- The point here is that Handle__ is an existential type,
+-- so the haDevice field can't be updated.
+--
+-- The bug was that, haDevice is a "naughty" selector, we
+-- couldn't find its type constructor.
+--
+-- This only happened when you go via an interface file, which is why
+-- this test imports an existential. To make the test more
+-- standalone, you'd need to make it a two-module test
+
+f :: Handle__ -> Handle__
+f h = h {haDevice=undefined}