From b1467fdcf79121391f6029ac9c686ac13d816d18 Mon Sep 17 00:00:00 2001 From: simonmar Date: Fri, 11 Jun 1999 16:10:19 +0000 Subject: [PATCH] [project @ 1999-06-11 16:10:18 by simonmar] - add a test for non-parsing of strict newtype constructor fields - other small fixes --- ghc/tests/reader/should_compile/read017.hs | 3 +++ ghc/tests/reader/should_fail/expr001.hs | 4 +++- ghc/tests/reader/should_fail/read008.hs | 5 +++++ ghc/tests/reader/should_fail/read008.stderr | 4 ++++ 4 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 ghc/tests/reader/should_fail/read008.hs create mode 100644 ghc/tests/reader/should_fail/read008.stderr diff --git a/ghc/tests/reader/should_compile/read017.hs b/ghc/tests/reader/should_compile/read017.hs index 3117391..e87fede 100644 --- a/ghc/tests/reader/should_compile/read017.hs +++ b/ghc/tests/reader/should_compile/read017.hs @@ -10,3 +10,6 @@ x = 2 where y = 3 instance Foo Int where + +f = f where g = g where +type T = Int diff --git a/ghc/tests/reader/should_fail/expr001.hs b/ghc/tests/reader/should_fail/expr001.hs index 03b34d9..764ffd9 100644 --- a/ghc/tests/reader/should_fail/expr001.hs +++ b/ghc/tests/reader/should_fail/expr001.hs @@ -1,3 +1,5 @@ +module ShouldFail where + {- From: Kevin Hammond To: partain @@ -8,7 +10,7 @@ OK, I've fixed that little problem by disallowing, -} module Test where -f x = x + if c then 1 else 2 +f x = x + if True then 1 else 2 f x = x + 1::Int -- (the conditional/sig need to be parenthesised). If this is diff --git a/ghc/tests/reader/should_fail/read008.hs b/ghc/tests/reader/should_fail/read008.hs new file mode 100644 index 0000000..606af91 --- /dev/null +++ b/ghc/tests/reader/should_fail/read008.hs @@ -0,0 +1,5 @@ +module ShouldFail where + +-- strictness annotations on the argument to a newtype constructor +-- are not allowed. +newtype N a = T ![a] diff --git a/ghc/tests/reader/should_fail/read008.stderr b/ghc/tests/reader/should_fail/read008.stderr new file mode 100644 index 0000000..bf43cd6 --- /dev/null +++ b/ghc/tests/reader/should_fail/read008.stderr @@ -0,0 +1,4 @@ +read008.hs:5: parse error on input `!' + +Compilation had errors + -- 1.7.10.4