Don't skip validity checks for built-in classes (#17355)
[ghc.git] / testsuite / tests / typecheck / should_compile / tc184.hs
1 {-# LANGUAGE ImplicitParams, ExistentialQuantification #-}
2
3 -- Both these two fail in 6.2.2
4
5 module ShouldCompile where
6
7
8 -- A record with an 'existential' context that binds no
9 -- type vars, so record selectors should be OK
10 data Test1 = (?val::Bool) => Test1 { name :: String }
11
12 instance Show Test1 where
13 show p = name p
14
15
16 -- Same, but no record selector; GHC 6.2.2 failed because it tried
17 -- to derive generic to/from
18 data Test2 = (?val::Bool) => Test2 String
19 f (Test2 s) | ?val = s