diff options
-rw-r--r-- | testsuite/tests/typecheck/should_compile/T2497.hs | 6 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_compile/T2497.stderr | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/testsuite/tests/typecheck/should_compile/T2497.hs b/testsuite/tests/typecheck/should_compile/T2497.hs index 24933e086f..87b717ddbe 100644 --- a/testsuite/tests/typecheck/should_compile/T2497.hs +++ b/testsuite/tests/typecheck/should_compile/T2497.hs @@ -14,9 +14,13 @@ foo x = x -- Trac #2213; eq should not be reported as unused eq,beq :: Eq a => a -> a -> Bool +{-# NOINLINE [0] eq #-} +-- The pragma and [~1] in the RULE are to prevent an infinite loo +-- in the simplifier, where the RULE fires infinitely in its +-- own RHS eq = (==) -- Used beq = (==) -- Unused {-# RULES - "rule 1" forall x y. x == y = y `eq` x + "rule 1" [~1] forall x y. x == y = y `eq` x #-} diff --git a/testsuite/tests/typecheck/should_compile/T2497.stderr b/testsuite/tests/typecheck/should_compile/T2497.stderr index cd7ad8bc20..da730a05aa 100644 --- a/testsuite/tests/typecheck/should_compile/T2497.stderr +++ b/testsuite/tests/typecheck/should_compile/T2497.stderr @@ -1,2 +1,2 @@ -T2497.hs:18:1: Warning: Defined but not used: ‘beq’ +T2497.hs:22:1: warning: Defined but not used: ‘beq’ |