Commit 14595510 authored by simonpj's avatar simonpj
Browse files

[project @ 2002-09-27 12:43:15 by simonpj]

Update expected output with improved error messages
parent b74cc4d1
......@@ -3,4 +3,5 @@ tcfail002.hs:4:
Occurs check: cannot construct the infinite type: a = [a]
Expected type: a
Inferred type: [a]
In the definition of `c': z
In a right-hand side of function `c': z
In the definition of `c': c z = z
./tcfail003.hs:3:
tcfail003.hs:3:
No instance for (Num Char)
arising from the literal `1' at ./tcfail003.hs:3
arising from the literal `1' at tcfail003.hs:3
In the list element: 1
In a pattern binding: [1, 'a']
In the right-hand side of a pattern binding: [1, 'a']
......@@ -3,4 +3,5 @@ tcfail004.hs:3:
Couldn't match `(t, t1)' against `(t2, t3, t4)'
Expected type: (t, t1)
Inferred type: (t2, t3, t4)
In a pattern binding: (1, 2, 3)
In the right-hand side of a pattern binding: (1, 2, 3)
In a pattern binding: (f, g) = (1, 2, 3)
......@@ -3,4 +3,5 @@ tcfail005.hs:3:
Couldn't match `[a]' against `(t, t1)'
Expected type: [a]
Inferred type: (t, t1)
In a pattern binding: (1, 'a')
In the right-hand side of a pattern binding: (1, 'a')
In a pattern binding: (h : i) = (1, 'a')
......@@ -2,4 +2,5 @@
tcfail006.hs:5:
No instance for (Num Bool)
arising from the literal `1' at tcfail006.hs:5
In a case alternative: (1, True)
In the body of a case alternative: (1, True)
In a case alternative: False -> (1, True)
......@@ -2,4 +2,7 @@
tcfail007.hs:3:
No instance for (Num Bool)
arising from use of `+' at tcfail007.hs:3
In the definition of `n': x + 1
In a right-hand side of function `n': x + 1
In the definition of `n':
n x | True = x + 1
| False = True
......@@ -3,4 +3,4 @@ tcfail008.hs:3:
No instance for (Num [a])
arising from the literal `2' at tcfail008.hs:3
In the second argument of `(:)', namely `2'
In the definition of `o': 1 : 2
In a right-hand side of function `o': 1 : 2
tcfail010.hs:3:
No instance for (Num [a])
arising from the literal `2' at tcfail010.hs:3
In the second argument of `(+)', namely `2'
In a lambda abstraction: z + 2
arising from use of `+' at tcfail010.hs:3
In the body of a lambda: z + 2
In a lambda abstraction: \ (y : z) -> z + 2
......@@ -3,4 +3,5 @@ tcfail012.hs:3:
Couldn't match `Bool' against `[a]'
Expected type: Bool
Inferred type: [a]
In a pattern binding: []
In the right-hand side of a pattern binding: []
In a pattern binding: True = []
tests/ghc-regress/typecheck/should_fail/tcfail014.hs:5:
tcfail014.hs:5:
Occurs check: cannot construct the infinite type: t = t -> t1
Expected type: t
Inferred type: t -> t1
In the first argument of `z', namely `z'
In the definition of `h': z z
In a right-hand side of function `h': z z
......@@ -2,4 +2,5 @@
tcfail015.hs:7:
No instance for (Num Bool)
arising from the literal `2' at tcfail015.hs:7
In the definition of `g': 2
In a right-hand side of function `g': 2
In the definition of `g': g (ANull) = 2
......@@ -2,4 +2,5 @@
tcfail018.hs:5:
No instance for (Num [a])
arising from the literal `1' at tcfail018.hs:5
In a pattern binding: 1
In the right-hand side of a pattern binding: 1
In a pattern binding: (a : []) = 1
./tcfail029.hs:6:
tcfail029.hs:6:
No instance for (Ord Foo)
arising from use of `>' at ./tcfail029.hs:6
In the definition of `f': x > Bar
arising from use of `>' at tcfail029.hs:6
In a right-hand side of function `f': x > Bar
In the definition of `f': f x = x > Bar
tests/ghc-regress/typecheck/should_fail/tcfail031.hs:3:
tcfail031.hs:3:
Couldn't match `Bool' against `Char'
Expected type: Bool
Inferred type: Char
In the predicate expression: 'a'
In the definition of `f': if 'a' then 1 else 2
In a right-hand side of function `f': if 'a' then 1 else 2
......@@ -6,4 +6,6 @@ tcfail032.hs:14:
x :: a -> Int (bound at tcfail032.hs:14)
When checking the type signature of the expression:
x :: forall a. (Eq a) => a -> Int
In the definition of `f': (x :: forall a. (Eq a) => a -> Int)
In a right-hand side of function `f':
(x :: forall a. (Eq a) => a -> Int)
In the definition of `f': f x = (x :: forall a. (Eq a) => a -> Int)
tests/ghc-regress/typecheck/should_fail/tcfail033.hs:4:
tcfail033.hs:4:
Occurs check: cannot construct the infinite type: t = (t, t1)
Expected type: (t, t1)
Inferred type: t
In a 'list comprehension' pattern binding: x
In the result of a list comprehension: x
In a right-hand side of function `buglet': [x | (x, y) <- buglet]
......@@ -5,4 +5,4 @@ tcfail034.hs:17:
Add (Integral a) to the type signature(s) for `test'
arising from use of `mod' at tcfail034.hs:17
In the first argument of `(==)', namely `(x `mod` 3)'
In the definition of `test': (x `mod` 3) == 0
In a right-hand side of function `test': (x `mod` 3) == 0
......@@ -3,4 +3,4 @@ tcfail040.hs:19:
Ambiguous type variable(s) `a' in the constraint `ORD a'
arising from use of `<<' at tcfail040.hs:19
In the first argument of `(===)', namely `(<<)'
In the definition of `f': (<<) === (<<)
In a right-hand side of function `f': (<<) === (<<)
......@@ -3,7 +3,7 @@ tcfail043.hs:38:
Ambiguous type variable(s) `a' in the constraint `Ord_ a'
arising from use of `gt' at tcfail043.hs:38
In the predicate expression: gt (hd bs) a
In a lambda abstraction:
In the body of a lambda:
if gt (hd bs) a then
False
else
......
......@@ -44,7 +44,8 @@ tcfail067.hs:61:
Probable fix:
Add (Ord a) to the class or instance method `negate'
arising from use of `numSubRangeNegate' at tcfail067.hs:61
In the definition of `negate': numSubRangeNegate
In a right-hand side of function `negate': numSubRangeNegate
In the definition of `negate': negate = numSubRangeNegate
tcfail067.hs:65:
Could not deduce (Ord a)
......@@ -55,13 +56,21 @@ tcfail067.hs:65:
Probable fix:
Add (Ord a) to the class or instance method `fromInteger'
arising from use of `SubRange' at tcfail067.hs:65
In the definition of `fromInteger':
In a right-hand side of function `fromInteger':
SubRange (fromInteger a, fromInteger a) (fromInteger a)
In the definition of `fromInteger':
fromInteger a = SubRange (fromInteger a, fromInteger a)
(fromInteger a)
tcfail067.hs:74:
Could not deduce (Ord a) from the context (Num a)
Probable fix:
Add (Ord a) to the type signature(s) for `numSubRangeBinOp'
arising from use of `SubRange' at tcfail067.hs:74
In the definition of `numSubRangeBinOp':
In a right-hand side of function `numSubRangeBinOp':
SubRange (result, result) result
In the definition of `numSubRangeBinOp':
numSubRangeBinOp op a b
= SubRange (result, result) result
where
result = (subRangeValue a) `op` (subRangeValue b)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment