[project @ 2001-08-22 11:45:06 by sewardj]
[ghc-hetmet.git] / ghc / tests / typecheck / should_run / tcrun006.hs
1 -- !!! Selectors for data and newtypes with contexts
2
3 -- This program, reported in Aug'00 by Jose Emilio Labra Gayo
4 -- gave rise to a Lint error because the selector 'newout' below
5 -- was given the type
6 --      Eq f => NewT f -> f
7 -- but lacked a dictionary argument in its body.
8
9 module Main where
10
11 newtype (Eq f) => NewT  f = NewIn  { newout  :: f } 
12 data    (Eq f) => DataT f = DataIn { dataout :: f } 
13
14 main = print (newout (NewIn "ok new") ++ dataout (DataIn " ok data"))
15