Commit 05065c90 authored by sewardj's avatar sewardj
Browse files

[project @ 2001-06-21 11:16:27 by sewardj]

Add typechecker should_fail tests.
parent 0a845eb3
include ($confdir ++ "/../vanilla-test.T")
-- Args to vtf are: extra compile flags
test "tcfail001" { vtf("") }
test "tcfail002" { vtf("") }
test "tcfail003" { vtf("") }
test "tcfail004" { vtf("") }
test "tcfail005" { vtf("") }
test "tcfail006" { vtf("") }
test "tcfail007" { vtf("") }
test "tcfail008" { vtf("") }
test "tcfail009" { vtf("") }
test "tcfail010" { vtf("") }
test "tcfail011" { vtf("") }
test "tcfail012" { vtf("") }
test "tcfail013" { vtf("") }
test "tcfail014" { vtf("") }
test "tcfail015" { vtf("") }
test "tcfail016" { vtf("") }
test "tcfail017" { vtf("") }
test "tcfail018" { vtf("") }
test "tcfail019" { vtf("") }
test "tcfail020" { vtf("") }
test "tcfail021" { vtf("") }
test "tcfail023" { vtf("") }
test "tcfail027" { vtf("") }
test "tcfail028" { vtf("") }
test "tcfail029" { vtf("") }
test "tcfail030" { vtf("") }
test "tcfail031" { vtf("") }
test "tcfail032" { vtf("") }
test "tcfail033" { vtf("") }
test "tcfail034" { vtf("") }
test "tcfail035" { vtf("") }
test "tcfail036" { vtf("") }
test "tcfail037" { vtf("") }
test "tcfail038" { vtf("") }
test "tcfail039" { vtf("") }
test "tcfail040" { vtf("") }
test "tcfail042" { vtf("") }
test "tcfail043" { vtf("") }
test "tcfail044" { vtf("") }
test "tcfail045" { vtf("-fglasgow-exts -package lang") }
test "tcfail046" { vtf("") }
test "tcfail047" { vtf("") }
test "tcfail048" { vtf("") }
test "tcfail049" { vtf("") }
test "tcfail050" { vtf("") }
test "tcfail051" { vtf("") }
test "tcfail052" { vtf("") }
test "tcfail053" { vtf("") }
test "tcfail054" { vtf("") }
test "tcfail055" { vtf("") }
test "tcfail056" { vtf("") }
test "tcfail057" { vtf("") }
test "tcfail058" { vtf("") }
test "tcfail061" { vtf("") }
test "tcfail062" { vtf("") }
test "tcfail063" { vtf("") }
test "tcfail065" { vtf("") }
test "tcfail067" { vtf("") }
test "tcfail068" { vtf("-fglasgow-exts -package lang") }
test "tcfail069" { vtf("") }
test "tcfail070" { vtf("") }
test "tcfail071" { vtf("") }
test "tcfail072" { vtf("") }
test "tcfail073" { vtf("") }
test "tcfail075" { vtf("") }
test "tcfail076" { vtf("") }
test "tcfail077" { vtf("") }
test "tcfail078" { vtf("") }
test "tcfail079" { vtf("") }
test "tcfail080" { vtf("-fglasgow-exts -package lang") }
test "tcfail082" { vtf("") }
test "tcfail083" { vtf("") }
test "tcfail084" { vtf("") }
test "tcfail085" { vtf("") }
test "tcfail086" { vtf("") }
test "tcfail087" { vtf("") }
test "tcfail088" { vtf("") }
test "tcfail089" { vtf("-O") }
test "tcfail090" { vtf("") }
test "tcfail091" { vtf("") }
test "tcfail092" { vtf("") }
test "tcfail093" { vtf("") }
-- !!! This should fail with a type error: the instance method
-- !!! has a function type when it should have the type [a].
module ShouldFail where
class A a where
op :: a
instance (A a, A a) => A [a] where
op [] = []
tcfail001.hs:8:
Warning: Duplicate class assertion `A a' in the context:
(A a, A a) => ...
tcfail001.hs:9:
Couldn't match `[a]' against `t -> t1'
Expected type: [a]
Inferred type: t -> t1
In an equation for function `op': op [] = []
In the definition for method `op'
module ShouldFail where
c (x:y) = x
c z = z
tcfail002.hs:4:
Occurs check: cannot construct the infinite type: t = [t]
Expected type: t
Inferred type: [t]
in the definition of function `c': z
tcfail003.hs:3:
No instance for `Num Char'
arising from the literal `1' at tcfail003.hs:3
In the list element: 1
in a pattern binding: [1, 'a']
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)
tcfail005.hs:3:
Couldn't match `[t]' against `(t1, t2)'
Expected type: [t]
Inferred type: (t1, t2)
in a pattern binding: (1, 'a')
module ShouldFail where
(j,k) = case (if True then True else False) of
True -> (True,1)
False -> (1,True)
tcfail006.hs:5:
No instance for `Num Bool'
arising from the literal `1' at tcfail006.hs:5
in a group of case alternatives beginning: (1, True)
module ShouldFail where
n x | True = x+1
| False = True
tcfail007.hs:3:
No instance for `Num Bool'
arising from the literal `1' at tcfail007.hs:3
In the second argument of `(+)', namely `1'
in the definition of function `n': x + 1
tcfail008.hs:3:
No instance for `Num [t]'
arising from the literal `2' at tcfail008.hs:3
In the second argument of `(:)', namely `2'
in the definition of function `o': 1 : 2
tcfail008.hs:3:
Ambiguous type variable(s) `t' in the constraint `Num t'
arising from the literal `1' at tcfail008.hs:3
In the first argument of `(:)', namely `1'
in the definition of function `o': 1 : 2
module ShouldFail where
p = [(1::Int)..(2::Integer)]
tcfail009.hs:3:
Couldn't match `Integer' against `Int'
Expected type: Integer
Inferred type: Int
In an expression with a type signature: 2 :: Integer
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