summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Smeding <tom@tomsmeding.com>2026-07-02 00:08:31 +0200
committerTom Smeding <tom@tomsmeding.com>2026-07-02 00:08:31 +0200
commitfab30ebbff962e1444a6a6482b9f54283bfd2f2a (patch)
tree23616fb68d11820563b94ac2b9722e9f053e733a
parentc332a4e4b2f26cfd388e036f60dbef3162e5059d (diff)
Add wrong :: IORef [a] that doesn't typecheck
-rw-r--r--test/Main.hs3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/Main.hs b/test/Main.hs
index f2ebfa2..d314ed4 100644
--- a/test/Main.hs
+++ b/test/Main.hs
@@ -9,6 +9,9 @@ import InitOnce
globalRef :: IORef Int
globalRef = $$(once [|| newIORef 0 ||])
+-- wrong :: Typeable a => IORef [a] -- does not typecheck: no instance Typeable a
+-- wrong = $$(once [|| newIORef [] ||])
+
{-# NOINLINE foo #-}
foo :: IO String
foo = atomicModifyIORef' globalRef (\i -> (i + 1, show i))