diff --git a/ghc/tests/typecheck/should_run/tcrun006.hs b/ghc/tests/typecheck/should_run/tcrun006.hs new file mode 100644 index 0000000000000000000000000000000000000000..c55ef8850e3f8e5ce0fc08e8738a188d68c9380b --- /dev/null +++ b/ghc/tests/typecheck/should_run/tcrun006.hs @@ -0,0 +1,15 @@ +-- !!! Selectors for data and newtypes with contexts + +-- This program, reported in Aug'00 by Jose Emilio Labra Gayo +-- gave rise to a Lint error because the selector 'newout' below +-- was given the type +-- Eq f => NewT f -> f +-- but lacked a dictionary argument in its body. + +module Main where + +newtype (Eq f) => NewT f = NewIn { newout :: f } +data (Eq f) => DataT f = DataIn { dataout :: f } + +main = print (newout (NewIn "ok new") ++ dataout (DataIn " ok data")) + diff --git a/ghc/tests/typecheck/should_run/tcrun006.stdout b/ghc/tests/typecheck/should_run/tcrun006.stdout new file mode 100644 index 0000000000000000000000000000000000000000..e96d077c6e4c5574aae9cd9a4708b876acba9090 --- /dev/null +++ b/ghc/tests/typecheck/should_run/tcrun006.stdout @@ -0,0 +1 @@ +"ok new ok data"