Commit 1a8b752d authored by Joachim Breitner's avatar Joachim Breitner

Add (failing) test case for #11347

Unfortunately, I could not add the expected error message, so if someone
accidentally fixes this bug, this test will still be failing (no harm).
But maybe someone stumbles over it then and can update the expected
output.
parent 0acdcf24
-- Should AllowAmbiguousTypes relaly be needed here?
{-# LANGUAGE TypeFamilies, GeneralizedNewtypeDeriving, MultiParamTypeClasses, FlexibleInstances, AllowAmbiguousTypes #-}
module T11347 where
newtype Id1 a = MkId1 a
newtype Id2 a = MkId2 (Id1 a) deriving (UnsafeCast b)
type family Discern a b
type instance Discern (Id1 a) b = a
type instance Discern (Id2 a) b = b
class UnsafeCast to from where
unsafe :: from -> Discern from to
instance UnsafeCast b (Id1 a) where
unsafe (MkId1 x) = x
unsafeCoerce :: a -> b
unsafeCoerce x = unsafe (MkId2 (MkId1 x))
dummy stderr:
here should be something about roles _not_ "No skolem info"
......@@ -398,3 +398,4 @@ test('T11112', normal, compile_fail, [''])
test('ClassOperator', normal, compile_fail, [''])
test('T11274', normal, compile_fail, [''])
test('T10619', normal, compile_fail, [''])
test('T11347', expect_broken(11347), 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