summaryrefslogtreecommitdiff
path: root/testsuite/tests/roles
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/roles')
-rw-r--r--testsuite/tests/roles/should_compile/Roles1.stderr64
-rw-r--r--testsuite/tests/roles/should_compile/Roles13.stderr3
-rw-r--r--testsuite/tests/roles/should_compile/Roles14.stderr6
-rw-r--r--testsuite/tests/roles/should_compile/Roles2.stderr17
-rw-r--r--testsuite/tests/roles/should_compile/Roles3.stderr29
-rw-r--r--testsuite/tests/roles/should_compile/Roles4.stderr11
-rw-r--r--testsuite/tests/roles/should_compile/T8958.stderr89
-rw-r--r--testsuite/tests/roles/should_fail/Roles12.stderr2
8 files changed, 71 insertions, 150 deletions
diff --git a/testsuite/tests/roles/should_compile/Roles1.stderr b/testsuite/tests/roles/should_compile/Roles1.stderr
index cd027f13f2..96d5603bbf 100644
--- a/testsuite/tests/roles/should_compile/Roles1.stderr
+++ b/testsuite/tests/roles/should_compile/Roles1.stderr
@@ -1,54 +1,20 @@
TYPE SIGNATURES
TYPE CONSTRUCTORS
- T1 :: * -> *
- data T1 a
- No C type associated
- Roles: [nominal]
- RecFlag NonRecursive, Promotable
- = K1 :: forall a. a -> T1 a Stricts: _
- FamilyInstance: none
- T2 :: * -> *
- data T2 a
- No C type associated
- Roles: [representational]
- RecFlag NonRecursive, Promotable
- = K2 :: forall a. a -> T2 a Stricts: _
- FamilyInstance: none
- T3 :: k -> *
- data T3 (k::BOX) (a::k)
- No C type associated
- Roles: [nominal, phantom]
- RecFlag NonRecursive, Not promotable
- = K3 :: forall (k::BOX) (a::k). T3 k a
- FamilyInstance: none
- T4 :: (* -> *) -> * -> *
- data T4 (a::* -> *) b
- No C type associated
- Roles: [nominal, nominal]
- RecFlag NonRecursive, Not promotable
- = K4 :: forall (a::* -> *) b. (a b) -> T4 a b Stricts: _
- FamilyInstance: none
- T5 :: * -> *
- data T5 a
- No C type associated
- Roles: [representational]
- RecFlag NonRecursive, Promotable
- = K5 :: forall a. a -> T5 a Stricts: _
- FamilyInstance: none
- T6 :: k -> *
- data T6 (k::BOX) (a::k)
- No C type associated
- Roles: [nominal, phantom]
- RecFlag NonRecursive, Not promotable
- = K6 :: forall (k::BOX) (a::k). T6 k a
- FamilyInstance: none
- T7 :: k -> * -> *
- data T7 (k::BOX) (a::k) b
- No C type associated
- Roles: [nominal, phantom, representational]
- RecFlag NonRecursive, Not promotable
- = K7 :: forall (k::BOX) (a::k) b. b -> T7 k a b Stricts: _
- FamilyInstance: none
+ type role T1 nominal
+ data T1 a = K1 a
+ Promotable
+ data T2 a = K2 a
+ Promotable
+ type role T3 phantom
+ data T3 (a :: k) = K3
+ type role T4 nominal nominal
+ data T4 (a :: * -> *) b = K4 (a b)
+ data T5 a = K5 a
+ Promotable
+ type role T6 phantom
+ data T6 (a :: k) = K6
+ type role T7 phantom representational
+ data T7 (a :: k) b = K7 b
COERCION AXIOMS
Dependent modules: []
Dependent packages: [base, ghc-prim, integer-gmp]
diff --git a/testsuite/tests/roles/should_compile/Roles13.stderr b/testsuite/tests/roles/should_compile/Roles13.stderr
index 647e59ba51..b0dda24f2c 100644
--- a/testsuite/tests/roles/should_compile/Roles13.stderr
+++ b/testsuite/tests/roles/should_compile/Roles13.stderr
@@ -13,8 +13,7 @@ Roles13.convert =
`cast` (<Roles13.Wrap Roles13.Age>_R
-> Roles13.NTCo:Wrap[0] Roles13.NTCo:Age[0]
:: (Roles13.Wrap Roles13.Age -> Roles13.Wrap Roles13.Age)
- ~#
- (Roles13.Wrap Roles13.Age -> GHC.Types.Int))
+ ~R# (Roles13.Wrap Roles13.Age -> GHC.Types.Int))
diff --git a/testsuite/tests/roles/should_compile/Roles14.stderr b/testsuite/tests/roles/should_compile/Roles14.stderr
index 13231931e3..e0f26a14d3 100644
--- a/testsuite/tests/roles/should_compile/Roles14.stderr
+++ b/testsuite/tests/roles/should_compile/Roles14.stderr
@@ -1,9 +1,7 @@
TYPE SIGNATURES
TYPE CONSTRUCTORS
- C2 :: * -> Constraint
- class C2 a
- Roles: [representational]
- RecFlag NonRecursive
+ type role C2 representational
+ class C2 a where
meth2 :: a -> a
COERCION AXIOMS
axiom Roles12.NTCo:C2 :: C2 a = a -> a
diff --git a/testsuite/tests/roles/should_compile/Roles2.stderr b/testsuite/tests/roles/should_compile/Roles2.stderr
index f5bcbe6829..2c7ab6c66f 100644
--- a/testsuite/tests/roles/should_compile/Roles2.stderr
+++ b/testsuite/tests/roles/should_compile/Roles2.stderr
@@ -1,19 +1,8 @@
TYPE SIGNATURES
TYPE CONSTRUCTORS
- T1 :: * -> *
- data T1 a
- No C type associated
- Roles: [representational]
- RecFlag NonRecursive, Not promotable
- = K1 :: forall a. (IO a) -> T1 a Stricts: _
- FamilyInstance: none
- T2 :: * -> *
- data T2 a
- No C type associated
- Roles: [representational]
- RecFlag NonRecursive, Not promotable
- = K2 :: forall a. (FunPtr a) -> T2 a Stricts: _
- FamilyInstance: none
+ data T1 a = K1 (IO a)
+ type role T2 phantom
+ data T2 a = K2 (FunPtr a)
COERCION AXIOMS
Dependent modules: []
Dependent packages: [base, ghc-prim, integer-gmp]
diff --git a/testsuite/tests/roles/should_compile/Roles3.stderr b/testsuite/tests/roles/should_compile/Roles3.stderr
index 62eb2a9474..270afca9cd 100644
--- a/testsuite/tests/roles/should_compile/Roles3.stderr
+++ b/testsuite/tests/roles/should_compile/Roles3.stderr
@@ -1,31 +1,16 @@
TYPE SIGNATURES
TYPE CONSTRUCTORS
- C1 :: * -> Constraint
- class C1 a
- Roles: [nominal]
- RecFlag NonRecursive
+ class C1 a where
meth1 :: a -> a
- C2 :: * -> * -> Constraint
- class C2 a b
- Roles: [nominal, nominal]
- RecFlag NonRecursive
- meth2 :: (~) * a b -> a -> b
- C3 :: * -> * -> Constraint
- class C3 a b
- Roles: [nominal, nominal]
- RecFlag NonRecursive
- type family F3 b :: * (open)
+ class C2 a b where
+ meth2 :: a ~ b => a -> b
+ class C3 a b where
+ type family F3 b :: * open
meth3 :: a -> F3 b -> F3 b
- C4 :: * -> * -> Constraint
- class C4 a b
- Roles: [nominal, nominal]
- RecFlag NonRecursive
+ class C4 a b where
meth4 :: a -> F4 b -> F4 b
- F4 :: * -> *
- type family F4 a :: * (open)
- Syn1 :: * -> *
+ type family F4 a :: * open
type Syn1 a = F4 a
- Syn2 :: * -> *
type Syn2 a = [a]
COERCION AXIOMS
axiom Roles3.NTCo:C1 :: C1 a = a -> a
diff --git a/testsuite/tests/roles/should_compile/Roles4.stderr b/testsuite/tests/roles/should_compile/Roles4.stderr
index 32862ea073..f2b590fadd 100644
--- a/testsuite/tests/roles/should_compile/Roles4.stderr
+++ b/testsuite/tests/roles/should_compile/Roles4.stderr
@@ -1,16 +1,9 @@
TYPE SIGNATURES
TYPE CONSTRUCTORS
- C1 :: * -> Constraint
- class C1 a
- Roles: [nominal]
- RecFlag NonRecursive
+ class C1 a where
meth1 :: a -> a
- C3 :: * -> Constraint
- class C3 a
- Roles: [nominal]
- RecFlag NonRecursive
+ class C3 a where
meth3 :: a -> Syn1 a
- Syn1 :: * -> *
type Syn1 a = [a]
COERCION AXIOMS
axiom Roles4.NTCo:C1 :: C1 a = a -> a
diff --git a/testsuite/tests/roles/should_compile/T8958.stderr b/testsuite/tests/roles/should_compile/T8958.stderr
index 919530bb03..d400b9190c 100644
--- a/testsuite/tests/roles/should_compile/T8958.stderr
+++ b/testsuite/tests/roles/should_compile/T8958.stderr
@@ -1,49 +1,40 @@
-
-T8958.hs:1:31: Warning:
- -XDatatypeContexts is deprecated: It was widely considered a misfeature, and has been removed from the Haskell language.
-TYPE SIGNATURES
-TYPE CONSTRUCTORS
- Map :: * -> * -> *
- newtype (Nominal k, Representational v) => Map k v
- No C type associated
- Roles: [nominal, representational]
- RecFlag NonRecursive, Promotable
- = MkMap :: [(k, v)] -> Map k v Stricts: _
- FamilyInstance: none
- Nominal :: * -> Constraint
- class Nominal a
- Roles: [nominal]
- RecFlag NonRecursive
- Representational :: * -> Constraint
- class Representational a
- Roles: [representational]
- RecFlag NonRecursive
-COERCION AXIOMS
- axiom T8958.NTCo:Map :: Map k v = [(k, v)]
-INSTANCES
- instance [incoherent] Representational a
- -- Defined at T8958.hs:10:10
- instance [incoherent] Nominal a -- Defined at T8958.hs:7:10
-Dependent modules: []
-Dependent packages: [base, ghc-prim, integer-gmp]
-
-==================== Typechecker ====================
-AbsBinds [a] []
- {Exports: [T8958.$fRepresentationala <= $dRepresentational
- <>]
- Exported types: T8958.$fRepresentationala [InlPrag=[ALWAYS] CONLIKE]
- :: forall a. Representational a
- [LclIdX[DFunId],
- Str=DmdType,
- Unf=DFun: \ (@ a) -> T8958.D:Representational TYPE a]
- Binds: $dRepresentational = T8958.D:Representational}
-AbsBinds [a] []
- {Exports: [T8958.$fNominala <= $dNominal
- <>]
- Exported types: T8958.$fNominala [InlPrag=[ALWAYS] CONLIKE]
- :: forall a. Nominal a
- [LclIdX[DFunId],
- Str=DmdType,
- Unf=DFun: \ (@ a) -> T8958.D:Nominal TYPE a]
- Binds: $dNominal = T8958.D:Nominal}
-
+
+T8958.hs:1:31: Warning:
+ -XDatatypeContexts is deprecated: It was widely considered a misfeature, and has been removed from the Haskell language.
+TYPE SIGNATURES
+TYPE CONSTRUCTORS
+ type role Map nominal representational
+ newtype (Nominal k, Representational v) => Map k v = MkMap [(k, v)]
+ Promotable
+ class Nominal a
+ type role Representational representational
+ class Representational a
+COERCION AXIOMS
+ axiom T8958.NTCo:Map :: Map k v = [(k, v)]
+INSTANCES
+ instance [incoherent] Representational a
+ -- Defined at T8958.hs:10:10
+ instance [incoherent] Nominal a -- Defined at T8958.hs:7:10
+Dependent modules: []
+Dependent packages: [base, ghc-prim, integer-gmp]
+
+==================== Typechecker ====================
+AbsBinds [a] []
+ {Exports: [T8958.$fRepresentationala <= $dRepresentational
+ <>]
+ Exported types: T8958.$fRepresentationala [InlPrag=[ALWAYS] CONLIKE]
+ :: forall a. Representational a
+ [LclIdX[DFunId],
+ Str=DmdType,
+ Unf=DFun: \ (@ a) -> T8958.D:Representational TYPE a]
+ Binds: $dRepresentational = T8958.D:Representational}
+AbsBinds [a] []
+ {Exports: [T8958.$fNominala <= $dNominal
+ <>]
+ Exported types: T8958.$fNominala [InlPrag=[ALWAYS] CONLIKE]
+ :: forall a. Nominal a
+ [LclIdX[DFunId],
+ Str=DmdType,
+ Unf=DFun: \ (@ a) -> T8958.D:Nominal TYPE a]
+ Binds: $dNominal = T8958.D:Nominal}
+
diff --git a/testsuite/tests/roles/should_fail/Roles12.stderr b/testsuite/tests/roles/should_fail/Roles12.stderr
index bb830beae3..9b0f2cfdb5 100644
--- a/testsuite/tests/roles/should_fail/Roles12.stderr
+++ b/testsuite/tests/roles/should_fail/Roles12.stderr
@@ -4,4 +4,4 @@ Roles12.hs:5:1:
and its hs-boot file
Main module: type role T phantom
data T a
- Boot file: data T a
+ Boot file: abstract T a