From 41f07b118c4fb7d7bc6c4a72efdb168b81d78675 Mon Sep 17 00:00:00 2001 From: simonpj <unknown> Date: Wed, 30 Aug 2000 07:36:47 +0000 Subject: [PATCH] [project @ 2000-08-30 07:36:47 by simonpj] Add test for selectors in data/newtype with contexts --- ghc/tests/typecheck/should_run/tcrun006.hs | 15 +++++++++++++++ ghc/tests/typecheck/should_run/tcrun006.stdout | 1 + 2 files changed, 16 insertions(+) create mode 100644 ghc/tests/typecheck/should_run/tcrun006.hs create mode 100644 ghc/tests/typecheck/should_run/tcrun006.stdout diff --git a/ghc/tests/typecheck/should_run/tcrun006.hs b/ghc/tests/typecheck/should_run/tcrun006.hs new file mode 100644 index 000000000000..c55ef8850e3f --- /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 000000000000..e96d077c6e4c --- /dev/null +++ b/ghc/tests/typecheck/should_run/tcrun006.stdout @@ -0,0 +1 @@ +"ok new ok data" -- GitLab