From fab30ebbff962e1444a6a6482b9f54283bfd2f2a Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Wed, 1 Jul 2026 23:08:31 +0100 Subject: Add wrong :: IORef [a] that doesn't typecheck --- test/Main.hs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'test/Main.hs') 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)) -- cgit v1.3.1