Update Trac ticket URLs to point to GitLab
[ghc.git] / testsuite / tests / typecheck / should_compile / T2497.hs
1 {-# OPTIONS_GHC -fwarn-unused-binds #-}
2
3 module ShouldCompile() where
4
5 foo x = x
6 {-# NOINLINE [1] foo #-}
7
8 -- #2497; test should compile without language
9 -- pragmas to switch on the forall
10 {-# RULES "id" forall (x :: a). foo x = x #-}
11
12
13
14 -- #2213; eq should not be reported as unused
15
16 eq,beq :: Eq a => a -> a -> Bool
17 {-# NOINLINE [0] eq #-}
18 -- The pragma and [~1] in the RULE are to prevent an infinite loop
19 -- in the simplifier, where the RULE fires infinitely in its
20 -- own RHS
21 eq = (==) -- Used
22 beq = (==) -- Unused
23
24 {-# RULES
25 "rule 1" [~1] forall x y. x == y = y `eq` x
26 #-}