diff options
Diffstat (limited to 'testsuite/tests/simplCore/should_compile/rule1.hs')
-rw-r--r-- | testsuite/tests/simplCore/should_compile/rule1.hs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/testsuite/tests/simplCore/should_compile/rule1.hs b/testsuite/tests/simplCore/should_compile/rule1.hs new file mode 100644 index 0000000000..923f4805fb --- /dev/null +++ b/testsuite/tests/simplCore/should_compile/rule1.hs @@ -0,0 +1,19 @@ +
+-- This one triggers the bug reported in Trac #1092
+-- The problem is that the rule
+-- forall w. f (\v->w) = w
+-- erroneously matches the call
+-- f id
+--
+-- Lint catches the error
+
+module Foo where
+
+f :: (Int -> Int) -> Int
+{-# NOINLINE f #-}
+f g = g 4
+{-# RULES
+ "f" forall w. f (\v->w) = w
+ #-}
+
+h = f id
|