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

Test Trac #5334, #5331

parent d6b1a57f
{-# LANGUAGE GADTs, ScopedTypeVariables #-}
{-# OPTIONS_GHC -Wall #-}
module Foo where
data T a
instance Eq (T a)
{-# SPECIALISE instance forall a.Eq (T Int) #-}
data S = forall a.S1
data W where
W1 :: forall a. W
f :: forall a. Int
f = 3
T5331.hs:9:32:
Warning: Unused quantified type variable `a'
In the type `forall a. Eq (T Int)'
In a SPECIALISE instance pragma
T5331.hs:11:17:
Warning: Unused quantified type variable `a'
In the definition of data constructor `S1'
T5331.hs:14:16:
Warning: Unused quantified type variable `a'
In the definition of data constructor `W1'
T5331.hs:16:13:
Warning: Unused quantified type variable `a'
In the type `forall a. Int'
In the type signature for `f'
{-# LANGUAGE RecordWildCards #-}
module T5334 where
data T = T { a, b :: Int }
t = T {..}
where
a = 1
-- b = 2
data S = S { x, y :: Int }
s = S { x = 1 }
T5334.hs:7:5:
Warning: Fields of `T' not initialised: b
In the expression: T {..}
In an equation for `t':
t = T {..}
where
a = 1
T5334.hs:14:5:
Warning: Fields of `S' not initialised: y
In the expression: S {x = 1}
In an equation for `s': s = S {x = 1}
......@@ -175,3 +175,5 @@ test('T2436',
extra_clean(['T2436a.hi', 'T2436a.o']) ],
multimod_compile,
['T2436', '-v0'])
test('T5331', normal, compile, ['']) # Unused tyvar warnings
test('T5334', normal, compile, ['']) # Unused tyvar warnings
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