Commit 434514a7 authored by simonpj's avatar simonpj
Browse files

[project @ 2005-12-16 14:56:50 by simonpj]

Add repeated-type-variable tests for instance constexts
parent ae0204bf
...@@ -138,3 +138,4 @@ test('tcfail150', normal, compile_fail, ['']) ...@@ -138,3 +138,4 @@ test('tcfail150', normal, compile_fail, [''])
test('tcfail151', normal, compile_fail, ['']) test('tcfail151', normal, compile_fail, [''])
test('tcfail152', normal, compile_fail, ['']) test('tcfail152', normal, compile_fail, [''])
test('tcfail153', normal, compile_fail, ['']) test('tcfail153', normal, compile_fail, [''])
test('tcfail154', normal, compile_fail, [''])
{-# OPTIONS -fglasgow-exts #-}
module ShouldFail where
data T a = MkT
class C a b where
op :: T a -> T b -> Bool
-- Repeated type variable in an instance constraint
-- should require -fallow-undecidable-instances
instance C a a => Eq (T a) where
(==) = op
tcfail154.hs:12:0:
Non-type variables, or repeated type variables,
in the constraint: C a a
(Use -fallow-undecidable-instances to permit this)
In the context: (C a a)
While checking the context of an instance declaration
In the instance declaration for `Eq (T a)'
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