Commit e4992dc4 authored by Simon Peyton Jones's avatar Simon Peyton Jones
Browse files

Test for deprecated constructors

parent 2f75acaa
module Rn050_A where
{-# DEPRECATED C "Use D instead" #-}
{-# DEPRECATED op "Use bop instead" #-}
data T = C | D
class Foo a where
op :: a -> a
bop :: a -> a
......@@ -46,6 +46,9 @@ test('rn047', normal, compile, ['-W'])
test('rn048', normal, compile, ['-W'])
test('rn049', normal, compile, ['-W'])
test('rn050', normal, multimod_compile, ['rn050', '-v0'])
clean(['Rn050_A.hi', 'Rn050_A.o'])
test('timing001', normal, compile, [''])
test('timing002', normal, compile, [''])
test('timing003', normal, compile, [''])
{-# OPTIONS_GHC -fwarn-deprecations #-}
-- Test deprecation of constructors and class ops
module ShouldCompile where
import Rn050_A
instance Foo T where
op x = x
bop y = y
foo = op C
rn050.hs:7:0:
Warning: Deprecated use of data constructor `C'
(imported from Rn050_A):
Use D instead
rn050.hs:7:0:
Warning: Deprecated use of `op'
(imported from Rn050_A):
Use bop instead
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