Commit 06f2a007 authored by Ian Lynagh's avatar Ian Lynagh
Browse files

Add a test for the WARNING pragma

parent 9b09753c
module Rn066_A where
{-# WARNING C "Are you sure you want to do that?" #-}
{-# WARNING op "Is that really a good idea?" #-}
data T = C | D
class Foo a where
op :: a -> a
bop :: a -> a
......@@ -104,6 +104,10 @@ test('rn065',
multimod_compile,
['rn065', '-v0'])
test('rn066',
extra_clean(['Rn066_A.hi', 'Rn066_A.o']),
multimod_compile, ['rn066', '-v0'])
test('T1972', if_compiler_lt('ghc', '6.9', expect_fail), compile, [''])
test('T2205', normal, compile, [''])
......
{-# OPTIONS_GHC -fwarn-warnings-deprecations #-}
-- Test warnings on constructors and class ops
module ShouldCompile where
import Rn066_A
instance Foo T where
op x = x
bop y = y
foo = op C
rn066.hs:7:0:
Warning: In the use of data constructor `C'
(imported from Rn066_A):
"Are you sure you want to do that?"
rn066.hs:7:0:
Warning: In the use of `op'
(imported from Rn066_A):
"Is that really a good idea?"
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