From: sof Date: Thu, 11 Jun 1998 10:32:10 +0000 (+0000) Subject: [project @ 1998-06-11 10:32:06 by sof] X-Git-Tag: Approx_2487_patches~581 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=eff637ebe3ad45bd00641520ea1806d8b72fe912;p=ghc-hetmet.git [project @ 1998-06-11 10:32:06 by sof] Testing the illegal use of pattern syntax in expressions (and vice versa) --- diff --git a/ghc/tests/reader/should_fail/read003.stderr b/ghc/tests/reader/should_fail/read003.stderr index 690ebe4..706a4e1 100644 --- a/ghc/tests/reader/should_fail/read003.stderr +++ b/ghc/tests/reader/should_fail/read003.stderr @@ -14,9 +14,9 @@ module Read003 where read003.hs:8: Occurs check: cannot construct the infinite type: - aMm = (aMm, aMp, aMs) - Expected: (aMm, [aMA], aMs) - Inferred: aMm + aKy = (aKy, aKB, aKE) + Expected: (aKy, [aKM], aKE) + Inferred: aKy In a pattern binding: ~(a, b, c) | nullity b = a diff --git a/ghc/tests/reader/should_fail/read006.hs b/ghc/tests/reader/should_fail/read006.hs new file mode 100644 index 0000000..feae50f --- /dev/null +++ b/ghc/tests/reader/should_fail/read006.hs @@ -0,0 +1,9 @@ +--!!! Using pattern syntax on RHS +module ShouldFail where + +f :: Int -> Int +f x = _ + +g :: Int -> Int +g x = 2 + 2@_ + diff --git a/ghc/tests/reader/should_fail/read006.stderr b/ghc/tests/reader/should_fail/read006.stderr new file mode 100644 index 0000000..d7814a4 --- /dev/null +++ b/ghc/tests/reader/should_fail/read006.stderr @@ -0,0 +1 @@ +read006.hs:5:7: pattern syntax used in expression on input: "_" diff --git a/ghc/tests/reader/should_fail/read007.hs b/ghc/tests/reader/should_fail/read007.hs new file mode 100644 index 0000000..bb9e658 --- /dev/null +++ b/ghc/tests/reader/should_fail/read007.hs @@ -0,0 +1,8 @@ +--!!! Expressions as patterns inside do stmt blocks +module ShouldFail where + +f :: Int -> IO Int +f x = do + (2+2) <- 2 + return x + diff --git a/ghc/tests/reader/should_fail/read007.stderr b/ghc/tests/reader/should_fail/read007.stderr new file mode 100644 index 0000000..2afd40e --- /dev/null +++ b/ghc/tests/reader/should_fail/read007.stderr @@ -0,0 +1 @@ +read007.hs:7:3: variable application in pattern on input: "return"