Commit 55754ea3 authored by Simon Peyton Jones's avatar Simon Peyton Jones

Fix test T2497 to avoid infinite loop in RULES

parent 7a6ed665
......@@ -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
#-}
T2497.hs:18:1: Warning: Defined but not used: ‘beq’
T2497.hs:22:1: warning: Defined but not used: ‘beq’
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment