From 0a85c215d884ec5fea00c323aa8d25345f9e53bc Mon Sep 17 00:00:00 2001 From: sof Date: Thu, 16 Sep 1999 19:26:01 +0000 Subject: [PATCH] [project @ 1999-09-16 19:26:01 by sof] checking Main.main's type + newtype def that caused a ghc-X (X<4.03, I think) TC crash --- ghc/tests/typecheck/should_compile/tc103.hs | 7 +++++++ ghc/tests/typecheck/should_compile/tc103.stderr | 5 +++++ ghc/tests/typecheck/should_compile/tc104.hs | 4 ++++ ghc/tests/typecheck/should_compile/tc104.stderr | 3 +++ 4 files changed, 19 insertions(+) create mode 100644 ghc/tests/typecheck/should_compile/tc103.hs create mode 100644 ghc/tests/typecheck/should_compile/tc103.stderr create mode 100644 ghc/tests/typecheck/should_compile/tc104.hs create mode 100644 ghc/tests/typecheck/should_compile/tc104.stderr diff --git a/ghc/tests/typecheck/should_compile/tc103.hs b/ghc/tests/typecheck/should_compile/tc103.hs new file mode 100644 index 0000000..06f3475 --- /dev/null +++ b/ghc/tests/typecheck/should_compile/tc103.hs @@ -0,0 +1,7 @@ +-- !!! Caused ghc-3.03 and 4.01 tc to enter a +-- !!! a blackhole (as reported by P. Callaghan.) +module ShouldCompile where + +type C a = D a -> a +newtype D a = DD (D_ a) +type D_ a = C (Maybe a) diff --git a/ghc/tests/typecheck/should_compile/tc103.stderr b/ghc/tests/typecheck/should_compile/tc103.stderr new file mode 100644 index 0000000..46f80b1 --- /dev/null +++ b/ghc/tests/typecheck/should_compile/tc103.stderr @@ -0,0 +1,5 @@ +ghc: module version changed to 1; reason: no old .hi file +__export ShouldCompile C D{DD} D_; +1 newtype D a = DD (D_ a) ; +1 type C a = D a -> a ; +1 type D_ a = C (PrelMaybe.Maybe a) ; diff --git a/ghc/tests/typecheck/should_compile/tc104.hs b/ghc/tests/typecheck/should_compile/tc104.hs new file mode 100644 index 0000000..25f354c --- /dev/null +++ b/ghc/tests/typecheck/should_compile/tc104.hs @@ -0,0 +1,4 @@ +-- !!! Checking that Main.main's type can now be of the form (IO a) +module Main(main) where + +main = putStrLn "Hello" >> return (id) diff --git a/ghc/tests/typecheck/should_compile/tc104.stderr b/ghc/tests/typecheck/should_compile/tc104.stderr new file mode 100644 index 0000000..8d6352d --- /dev/null +++ b/ghc/tests/typecheck/should_compile/tc104.stderr @@ -0,0 +1,3 @@ +ghc: module version changed to 1; reason: no old .hi file +__export Main main; +1 main :: __forall [a] => PrelIOBase.IO (a -> a) ; -- 1.7.10.4