blob: 5e4b711393fd44b95e9e5a1d06a43bfdaed4f7e7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
{-# LANGUAGE Rank2Types #-}
-- Test silly type synonyms
module ShouldCompile where
type C u a = u -- Note 'a' unused
foo :: (forall a. C u a -> C u a) -> u
foo x = undefined x
bar :: Num u => u
bar = foo (\t -> t + t)
-- The (Num u) should not get trapped inside the
-- /\a-abstraction which the compiler constructs for
-- the arg to foo. But it might because it's Num (C u a)!
-- This test tickles a bizarre corner case documented
-- as [Silly Type Synonym] in TcMType.lhs
|