Commit 305292eb authored by Simon Peyton Jones's avatar Simon Peyton Jones

Update test output, add NoMatchErr

parent a690b734
{-# LANGUAGE NoMonomorphismRestriction #-}
{-# LANGUAGE TypeFamilies #-}
-- Type error message looks like
-- TF.hs:12:11:
-- Couldn't match expected type `Memo d'
-- against inferred type `Memo d1'
-- NB: `Memo' is a (non-injective) type function
--
-- Note the "NB", which helps point out the problem
module Foo where
class Fun d where
type Memo d :: * -> *
abst :: (d -> a) -> Memo d a
appl :: Memo d a -> (d -> a)
f :: (Fun d) => Memo d a -> Memo d a -- (1)
f = abst . appl
NoMatchErr.hs:20:11:
Couldn't match expected type `Memo d'
against inferred type `Memo d1'
NB: `Memo' is a (non-injective) type function
In the second argument of `(.)', namely `appl'
In the expression: abst . appl
In the definition of `f': f = abst . appl
Simple16.hs:10:11:
Couldn't match expected type `p a' against inferred type `F ()'
NB: `F' is a (non-injective) type function
In the first argument of `foo', namely `(undefined :: F ())'
In the expression: foo (undefined :: F ())
In the definition of `bar': bar = foo (undefined :: F ())
......@@ -10,6 +10,7 @@ T1900.hs:11:12:
T1900.hs:14:21:
Couldn't match expected type `Depend s'
against inferred type `Depend s1'
NB: `Depend' is a (non-injective) type function
In the first argument of `trans', namely `d'
In the second argument of `(==)', namely `trans d'
In the expression: d == trans d
......@@ -2,6 +2,7 @@
T2627b.hs:20:13:
Couldn't match expected type `a'
against inferred type `Dual (Dual a)'
NB: `Dual' is a (non-injective) type function
In the pattern: Wr a r
In the definition of `conn':
conn (Rd k) (Wr a r) = conn undefined undefined
......@@ -2,6 +2,7 @@
T2693.hs:10:14:
Couldn't match expected type `(a1, b)'
against inferred type `TFn a'
NB: `TFn' is a (non-injective) type function
In the first argument of `fst', namely `x'
In the first argument of `(+)', namely `fst x'
In the expression: fst x + fst x
......@@ -49,3 +49,4 @@ test('T2627b', normal, compile_fail, [''])
test('T2693', normal, compile_fail, [''])
test('T2888', normal, compile_fail, [''])
test('T3092', normal, compile_fail, [''])
test('NoMatchErr', normal, compile_fail, [''])
Markdown is supported
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