Testing the illegal use of pattern syntax in expressions (and vice versa)
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
--- /dev/null
+--!!! Using pattern syntax on RHS
+module ShouldFail where
+
+f :: Int -> Int
+f x = _
+
+g :: Int -> Int
+g x = 2 + 2@_
+
--- /dev/null
+read006.hs:5:7: pattern syntax used in expression on input: "_"
--- /dev/null
+--!!! Expressions as patterns inside do stmt blocks
+module ShouldFail where
+
+f :: Int -> IO Int
+f x = do
+ (2+2) <- 2
+ return x
+
--- /dev/null
+read007.hs:7:3: variable application in pattern on input: "return"