Commit 99cd277c authored by eir@cis.upenn.edu's avatar eir@cis.upenn.edu
Browse files

Update tests to reflect new check for GeneralizedNewtypeDeriving

parent c43dd973
......@@ -3,5 +3,6 @@ T1496.hs:10:32:
Can't make a derived instance of ‛IsInt Moo’
(even with cunning newtype deriving):
it is not type-safe to use GeneralizedNewtypeDeriving on this class;
the last parameter of ‛IsInt’ is at role Nominal
‛isInt’, at type ‛forall (c :: * -> *).
c Int -> c t’, cannot be converted safely
In the newtype declaration for ‛Moo’
......@@ -4,5 +4,5 @@ T2721.hs:15:28:
(even with cunning newtype deriving):
the class has associated types
it is not type-safe to use GeneralizedNewtypeDeriving on this class;
the last parameter of ‛C’ is at role Nominal
‛foo’, at type ‛a -> T a’, cannot be converted safely
In the newtype declaration for ‛N’
......@@ -3,5 +3,5 @@ T4846.hs:29:1:
Can't make a derived instance of ‛B BOOL’
(even with cunning newtype deriving):
it is not type-safe to use GeneralizedNewtypeDeriving on this class;
the last parameter of ‛B’ is at role Nominal
‛mkExpr’, at type ‛Expr a’, cannot be converted safely
In the stand-alone deriving instance for ‛B BOOL’
......@@ -3,5 +3,8 @@ T7148.hs:27:40:
Can't make a derived instance of ‛IsoUnit (Tagged a b)’
(even with cunning newtype deriving):
it is not type-safe to use GeneralizedNewtypeDeriving on this class;
the last parameter of ‛IsoUnit’ is at role Nominal
‛iso1’, at type ‛forall b.
SameType () b -> SameType a b’, cannot be converted safely
‛iso2’, at type ‛forall b.
SameType b () -> SameType b a’, cannot be converted safely
In the newtype declaration for ‛Tagged’
......@@ -3,5 +3,6 @@ T7148a.hs:19:50:
Can't make a derived instance of ‛Convert (IS_NO_LONGER a)’
(even with cunning newtype deriving):
it is not type-safe to use GeneralizedNewtypeDeriving on this class;
the last parameter of ‛Convert’ is at role Nominal
‛coerce’, at type ‛forall b.
Proxy b -> a -> Result a b’, cannot be converted safely
In the newtype declaration for ‛IS_NO_LONGER’
......@@ -3,5 +3,5 @@ CasePrune.hs:14:31:
Can't make a derived instance of ‛C A’
(even with cunning newtype deriving):
it is not type-safe to use GeneralizedNewtypeDeriving on this class;
the last parameter of ‛C’ is at role Nominal
‛ic’, at type ‛T a’, cannot be converted safely
In the newtype declaration for ‛A’
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module RolesIArray where
import Data.Word
import Data.Array.IArray
import Data.Array.Unboxed
newtype N = MkN Word64
deriving (IArray UArray)
\ No newline at end of file
......@@ -3,3 +3,4 @@ test('Roles2', only_ways('normal'), compile, ['-ddump-tc'])
test('Roles3', only_ways('normal'), compile, ['-ddump-tc'])
test('Roles4', only_ways('normal'), compile, ['-ddump-tc'])
test('Roles13', only_ways('normal'), compile, ['-ddump-simpl -dsuppress-uniques'])
test('RolesIArray', only_ways('normal'), compile, [''])
\ No newline at end of file
......@@ -3,5 +3,5 @@ Roles10.hs:16:12:
Can't make a derived instance of ‛C Age’
(even with cunning newtype deriving):
it is not type-safe to use GeneralizedNewtypeDeriving on this class;
the last parameter of ‛C’ is at role Nominal
‛meth’, at type ‛a -> F a’, cannot be converted safely
In the newtype declaration for ‛Age’
{-# LANGUAGE GeneralizedNewtypeDeriving, RoleAnnotations #-}
module Roles9 where
type role C nominal
class C a where
meth :: a -> a
instance C Int where
meth = (+ 1)
newtype Age = MkAge Int
deriving C
......@@ -2,7 +2,6 @@ test('Roles5', normal, compile_fail, [''])
test('Roles6', normal, compile_fail, [''])
test('Roles7', normal, compile_fail, [''])
test('Roles8', normal, compile_fail, [''])
test('Roles9', normal, compile_fail, [''])
test('Roles10', normal, compile_fail, [''])
test('Roles11', normal, compile_fail, [''])
test('Roles12',
......
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