Commit 5830f5e1 authored by batterseapower's avatar batterseapower
Browse files

Add new tests for relaxed superclass cycle check

parent 67572e2b
......@@ -350,6 +350,8 @@ test('tc255', normal, compile, [''])
test('tc256', normal, compile, [''])
test('tc257', normal, compile, [''])
test('tc258', normal, compile, [''])
test('tc259', normal, compile, [''])
test('tc260', normal, compile, [''])
test('GivenOverlapping', normal, compile, [''])
test('SilentParametersOverlapping', normal, compile, [''])
......
-- Test we don't get a cycle for "phantom" superclasses
{-# LANGUAGE ConstraintKinds, MultiParamTypeClasses, FlexibleContexts #-}
module TcOK where
class A cls c where
meth :: cls c => c -> c
class A B c => B c where
-- Test we don't get a cycle for "phantom" superclasses,
-- even if the phantomness is behind a type synonym
{-# LANGUAGE ConstraintKinds, MultiParamTypeClasses, FlexibleContexts #-}
module TcOK where
class A ctxt c where
meth :: ctxt => c -> c
type Bish = B Int
class A Bish c => B c where
......@@ -244,6 +244,8 @@ test('tcfail212', normal, compile_fail, [''])
test('tcfail213', normal, compile_fail, [''])
test('tcfail214', normal, compile_fail, [''])
test('tcfail215', normal, compile_fail, [''])
test('tcfail216', normal, compile_fail, [''])
test('tcfail217', normal, compile_fail, [''])
test('FailDueToGivenOverlapping', normal, compile_fail, [''])
test('LongWayOverlapping', normal, compile_fail, [''])
......
-- Test we do get a cycle for superclasses escaping via a free tyvar
{-# LANGUAGE ConstraintKinds, MultiParamTypeClasses, UndecidableInstances #-}
module TcFail where
class cls (A cls) => A cls c where
tcfail216.hs:5:1:
Cycle in class declaration (via superclasses): A -> A
In the class declaration for `A'
-- Test we can't hide cycles with type synonyms
{-# LANGUAGE ConstraintKinds, MultiParamTypeClasses, UndecidableInstances #-}
module TcFail where
type Aish = A
class cls (Aish cls) => A cls c where
tcfail217.hs:7:1:
Cycle in class declaration (via superclasses): A -> Aish -> A
In the class declaration for `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