summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_compile/tc149.hs
blob: 5813604bc349079c3930f96fbfbec7e717d893a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{-# LANGUAGE RankNTypes #-}

module ShouldCompile where

type Generic i o = forall x. i x -> o x
type Id x = x

foo :: Generic Id Id
foo = error "urk"

-- The point here is that we instantiate "i" and "o" 
-- with a partially applied type synonym.  This is
-- OK in GHC because we check type validity only *after*
-- expanding type synonyms.
--
-- However, a bug in GHC 5.03-Feb02 made this break a
-- type invariant (see Type.mkAppTy)