Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
GHC
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
4,332
Issues
4,332
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
363
Merge Requests
363
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
fd20b873
Commit
fd20b873
authored
Aug 04, 2013
by
eir@cis.upenn.edu
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
ssh://darcs.haskell.org/srv/darcs/testsuite
parents
a3a99eb4
733b6eea
Changes
74
Hide whitespace changes
Inline
Side-by-side
Showing
74 changed files
with
720 additions
and
190 deletions
+720
-190
testsuite/tests/deSugar/should_compile/T2431.stderr
testsuite/tests/deSugar/should_compile/T2431.stderr
+2
-2
testsuite/tests/deriving/should_compile/Roles1.hs
testsuite/tests/deriving/should_compile/Roles1.hs
+13
-0
testsuite/tests/deriving/should_compile/Roles1.stderr
testsuite/tests/deriving/should_compile/Roles1.stderr
+50
-0
testsuite/tests/deriving/should_compile/Roles13.hs
testsuite/tests/deriving/should_compile/Roles13.hs
+12
-0
testsuite/tests/deriving/should_compile/Roles13.stderr
testsuite/tests/deriving/should_compile/Roles13.stderr
+20
-0
testsuite/tests/deriving/should_compile/Roles2.hs
testsuite/tests/deriving/should_compile/Roles2.hs
+9
-0
testsuite/tests/deriving/should_compile/Roles2.stderr
testsuite/tests/deriving/should_compile/Roles2.stderr
+20
-0
testsuite/tests/deriving/should_compile/Roles3.hs
testsuite/tests/deriving/should_compile/Roles3.hs
+21
-0
testsuite/tests/deriving/should_compile/Roles3.stderr
testsuite/tests/deriving/should_compile/Roles3.stderr
+35
-0
testsuite/tests/deriving/should_compile/Roles4.hs
testsuite/tests/deriving/should_compile/Roles4.hs
+15
-0
testsuite/tests/deriving/should_compile/Roles4.stderr
testsuite/tests/deriving/should_compile/Roles4.stderr
+25
-0
testsuite/tests/deriving/should_compile/all.T
testsuite/tests/deriving/should_compile/all.T
+7
-1
testsuite/tests/deriving/should_fail/Makefile
testsuite/tests/deriving/should_fail/Makefile
+4
-1
testsuite/tests/deriving/should_fail/Roles10.hs
testsuite/tests/deriving/should_fail/Roles10.hs
+16
-0
testsuite/tests/deriving/should_fail/Roles10.stderr
testsuite/tests/deriving/should_fail/Roles10.stderr
+7
-0
testsuite/tests/deriving/should_fail/Roles11.hs
testsuite/tests/deriving/should_fail/Roles11.hs
+7
-0
testsuite/tests/deriving/should_fail/Roles11.stderr
testsuite/tests/deriving/should_fail/Roles11.stderr
+5
-0
testsuite/tests/deriving/should_fail/Roles12.hs
testsuite/tests/deriving/should_fail/Roles12.hs
+5
-0
testsuite/tests/deriving/should_fail/Roles12.hs-boot
testsuite/tests/deriving/should_fail/Roles12.hs-boot
+3
-0
testsuite/tests/deriving/should_fail/Roles12.stderr
testsuite/tests/deriving/should_fail/Roles12.stderr
+12
-0
testsuite/tests/deriving/should_fail/Roles5.hs
testsuite/tests/deriving/should_fail/Roles5.hs
+5
-0
testsuite/tests/deriving/should_fail/Roles5.stderr
testsuite/tests/deriving/should_fail/Roles5.stderr
+15
-0
testsuite/tests/deriving/should_fail/Roles6.hs
testsuite/tests/deriving/should_fail/Roles6.hs
+5
-0
testsuite/tests/deriving/should_fail/Roles6.stderr
testsuite/tests/deriving/should_fail/Roles6.stderr
+5
-0
testsuite/tests/deriving/should_fail/Roles7.hs
testsuite/tests/deriving/should_fail/Roles7.hs
+6
-0
testsuite/tests/deriving/should_fail/Roles7.stderr
testsuite/tests/deriving/should_fail/Roles7.stderr
+4
-0
testsuite/tests/deriving/should_fail/Roles8.hs
testsuite/tests/deriving/should_fail/Roles8.hs
+5
-0
testsuite/tests/deriving/should_fail/Roles8.stderr
testsuite/tests/deriving/should_fail/Roles8.stderr
+5
-0
testsuite/tests/deriving/should_fail/Roles9.hs
testsuite/tests/deriving/should_fail/Roles9.hs
+12
-0
testsuite/tests/deriving/should_fail/Roles9.stderr
testsuite/tests/deriving/should_fail/Roles9.stderr
+7
-0
testsuite/tests/deriving/should_fail/T1496.hs
testsuite/tests/deriving/should_fail/T1496.hs
+16
-0
testsuite/tests/deriving/should_fail/T1496.stderr
testsuite/tests/deriving/should_fail/T1496.stderr
+7
-0
testsuite/tests/deriving/should_fail/T2721.stderr
testsuite/tests/deriving/should_fail/T2721.stderr
+2
-0
testsuite/tests/deriving/should_fail/T4846.hs
testsuite/tests/deriving/should_fail/T4846.hs
+37
-0
testsuite/tests/deriving/should_fail/T4846.stderr
testsuite/tests/deriving/should_fail/T4846.stderr
+7
-0
testsuite/tests/deriving/should_fail/T7148.hs
testsuite/tests/deriving/should_fail/T7148.hs
+39
-0
testsuite/tests/deriving/should_fail/T7148.stderr
testsuite/tests/deriving/should_fail/T7148.stderr
+7
-0
testsuite/tests/deriving/should_fail/T7148a.hs
testsuite/tests/deriving/should_fail/T7148a.hs
+37
-0
testsuite/tests/deriving/should_fail/T7148a.stderr
testsuite/tests/deriving/should_fail/T7148a.stderr
+7
-0
testsuite/tests/deriving/should_fail/all.T
testsuite/tests/deriving/should_fail/all.T
+15
-0
testsuite/tests/gadt/CasePrune.stderr
testsuite/tests/gadt/CasePrune.stderr
+7
-0
testsuite/tests/gadt/CasePrune.stdout
testsuite/tests/gadt/CasePrune.stdout
+0
-1
testsuite/tests/gadt/all.T
testsuite/tests/gadt/all.T
+1
-1
testsuite/tests/gadt/gadt11.hs
testsuite/tests/gadt/gadt11.hs
+6
-5
testsuite/tests/gadt/gadt11.stderr
testsuite/tests/gadt/gadt11.stderr
+5
-5
testsuite/tests/indexed-types/should_compile/T3017.stderr
testsuite/tests/indexed-types/should_compile/T3017.stderr
+3
-3
testsuite/tests/perf/compiler/all.T
testsuite/tests/perf/compiler/all.T
+7
-3
testsuite/tests/polykinds/T7272.hs-boot
testsuite/tests/polykinds/T7272.hs-boot
+2
-2
testsuite/tests/rename/should_compile/Imp100Aux.hs-boot
testsuite/tests/rename/should_compile/Imp100Aux.hs-boot
+11
-10
testsuite/tests/rename/should_compile/Imp10Aux.hs-boot
testsuite/tests/rename/should_compile/Imp10Aux.hs-boot
+12
-10
testsuite/tests/rename/should_compile/Imp500Aux.hs-boot
testsuite/tests/rename/should_compile/Imp500Aux.hs-boot
+11
-10
testsuite/tests/rename/should_fail/rnfail055.stderr
testsuite/tests/rename/should_fail/rnfail055.stderr
+16
-16
testsuite/tests/safeHaskell/safeLanguage/SafeLang06.hs
testsuite/tests/safeHaskell/safeLanguage/SafeLang06.hs
+0
-40
testsuite/tests/safeHaskell/safeLanguage/SafeLang06.stdout
testsuite/tests/safeHaskell/safeLanguage/SafeLang06.stdout
+0
-2
testsuite/tests/safeHaskell/safeLanguage/SafeLang06_A.hs
testsuite/tests/safeHaskell/safeLanguage/SafeLang06_A.hs
+0
-24
testsuite/tests/safeHaskell/safeLanguage/all.T
testsuite/tests/safeHaskell/safeLanguage/all.T
+5
-4
testsuite/tests/simplCore/should_compile/T4201.stdout
testsuite/tests/simplCore/should_compile/T4201.stdout
+1
-1
testsuite/tests/th/T1835.stdout
testsuite/tests/th/T1835.stdout
+1
-1
testsuite/tests/th/T4188.stderr
testsuite/tests/th/T4188.stderr
+6
-6
testsuite/tests/th/TH_Roles1.hs
testsuite/tests/th/TH_Roles1.hs
+8
-0
testsuite/tests/th/TH_Roles1.stderr
testsuite/tests/th/TH_Roles1.stderr
+5
-0
testsuite/tests/th/TH_Roles2.hs
testsuite/tests/th/TH_Roles2.hs
+8
-0
testsuite/tests/th/TH_Roles2.stderr
testsuite/tests/th/TH_Roles2.stderr
+16
-0
testsuite/tests/th/TH_Roles3.hs
testsuite/tests/th/TH_Roles3.hs
+9
-0
testsuite/tests/th/TH_Roles3.stderr
testsuite/tests/th/TH_Roles3.stderr
+3
-0
testsuite/tests/th/TH_reifyDecl1.stderr
testsuite/tests/th/TH_reifyDecl1.stderr
+6
-6
testsuite/tests/th/TH_reifyDecl2.stderr
testsuite/tests/th/TH_reifyDecl2.stderr
+2
-2
testsuite/tests/th/all.T
testsuite/tests/th/all.T
+4
-0
testsuite/tests/typecheck/should_compile/tc231.stderr
testsuite/tests/typecheck/should_compile/tc231.stderr
+29
-29
testsuite/tests/typecheck/should_fail/T3468.stderr
testsuite/tests/typecheck/should_fail/T3468.stderr
+1
-1
testsuite/tests/typecheck/should_fail/T7175.stderr
testsuite/tests/typecheck/should_fail/T7175.stderr
+1
-1
testsuite/tests/typecheck/should_fail/T7892.stderr
testsuite/tests/typecheck/should_fail/T7892.stderr
+1
-1
testsuite/tests/typecheck/should_fail/tcfail155.stderr
testsuite/tests/typecheck/should_fail/tcfail155.stderr
+1
-1
testsuite/tests/typecheck/should_fail/tcfail176.stderr
testsuite/tests/typecheck/should_fail/tcfail176.stderr
+1
-1
No files found.
testsuite/tests/deSugar/should_compile/T2431.stderr
View file @
fd20b873
...
@@ -9,8 +9,8 @@ T2431.$WRefl [InlPrag=INLINE] :: forall a. a T2431.:~: a
...
@@ -9,8 +9,8 @@ T2431.$WRefl [InlPrag=INLINE] :: forall a. a T2431.:~: a
Unf=Unf{Src=InlineStable, TopLvl=True, Arity=0, Value=True,
Unf=Unf{Src=InlineStable, TopLvl=True, Arity=0, Value=True,
ConLike=True, WorkFree=True, Expandable=True,
ConLike=True, WorkFree=True, Expandable=True,
Guidance=ALWAYS_IF(unsat_ok=False,boring_ok=False)
Guidance=ALWAYS_IF(unsat_ok=False,boring_ok=False)
Tmpl= \ (@ a) -> T2431.Refl @ a @ a @~ <a>}]
Tmpl= \ (@ a) -> T2431.Refl @ a @ a @~ <a>
_N
}]
T2431.$WRefl = \ (@ a) -> T2431.Refl @ a @ a @~ <a>
T2431.$WRefl = \ (@ a) -> T2431.Refl @ a @ a @~ <a>
_N
T2431.absurd
T2431.absurd
:: forall a. (GHC.Types.Int T2431.:~: GHC.Types.Bool) -> a
:: forall a. (GHC.Types.Int T2431.:~: GHC.Types.Bool) -> a
...
...
testsuite/tests/deriving/should_compile/Roles1.hs
0 → 100644
View file @
fd20b873
{-# LANGUAGE RoleAnnotations, PolyKinds #-}
module
Roles1
where
data
T1
a
@
N
=
K1
a
data
T2
a
@
R
=
K2
a
data
T3
(
a
::
k
)
@
P
=
K3
data
T4
(
a
::
*
->
*
)
@
N
b
=
K4
(
a
b
)
data
T5
a
=
K5
a
data
T6
a
=
K6
data
T7
a
b
=
K7
b
testsuite/tests/deriving/should_compile/Roles1.stderr
0 → 100644
View file @
fd20b873
TYPE SIGNATURES
TYPE CONSTRUCTORS
T1 :: * -> *
data T1 a@N
No C type associated
RecFlag NonRecursive, Promotable
= K1 :: forall a. a -> T1 a Stricts: _
FamilyInstance: none
T2 :: * -> *
data T2 a@R
No C type associated
RecFlag NonRecursive, Promotable
= K2 :: forall a. a -> T2 a Stricts: _
FamilyInstance: none
T3 :: forall (k :: BOX). k -> *
data T3 (k::BOX)@N (a::k)@P
No C type associated
RecFlag NonRecursive, Not promotable
= K3 :: forall (k::BOX) (a::k). T3 k a
FamilyInstance: none
T4 :: (* -> *) -> * -> *
data T4 (a::* -> *)@N b@N
No C type associated
RecFlag NonRecursive, Not promotable
= K4 :: forall (a::* -> *) b. (a b) -> T4 a b Stricts: _
FamilyInstance: none
T5 :: * -> *
data T5 a@R
No C type associated
RecFlag NonRecursive, Promotable
= K5 :: forall a. a -> T5 a Stricts: _
FamilyInstance: none
T6 :: forall (k :: BOX). k -> *
data T6 (k::BOX)@N (a::k)@P
No C type associated
RecFlag NonRecursive, Not promotable
= K6 :: forall (k::BOX) (a::k). T6 k a
FamilyInstance: none
T7 :: forall (k :: BOX). k -> * -> *
data T7 (k::BOX)@N (a::k)@P b@R
No C type associated
RecFlag NonRecursive, Not promotable
= K7 :: forall (k::BOX) (a::k) b. b -> T7 k a b Stricts: _
FamilyInstance: none
COERCION AXIOMS
Dependent modules: []
Dependent packages: [base, ghc-prim, integer-gmp]
==================== Typechecker ====================
testsuite/tests/deriving/should_compile/Roles13.hs
0 → 100644
View file @
fd20b873
{-# LANGUAGE TypeFamilies, GeneralizedNewtypeDeriving,
MultiParamTypeClasses, FunctionalDependencies #-}
-- tests axiom roles
module
Roles13
where
newtype
Age
=
MkAge
Int
newtype
Wrap
a
=
MkWrap
a
convert
::
Wrap
Age
->
Int
convert
(
MkWrap
(
MkAge
i
))
=
i
testsuite/tests/deriving/should_compile/Roles13.stderr
0 → 100644
View file @
fd20b873
==================== Tidy Core ====================
Result size of Tidy Core = {terms: 5, types: 9, coercions: 5}
a :: Roles13.Wrap Roles13.Age -> Roles13.Wrap Roles13.Age
[GblId, Arity=1, Caf=NoCafRefs, Str=DmdType]
a = \ (ds :: Roles13.Wrap Roles13.Age) -> ds
Roles13.convert :: Roles13.Wrap Roles13.Age -> GHC.Types.Int
[GblId, Arity=1, Caf=NoCafRefs, Str=DmdType]
Roles13.convert =
a
`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))
testsuite/tests/deriving/should_compile/Roles2.hs
0 → 100644
View file @
fd20b873
module
Roles2
where
import
GHC.Ptr
-- these *must* have certain roles, or things break strangely
-- see TcForeign
data
T1
a
=
K1
(
IO
a
)
data
T2
a
=
K2
(
FunPtr
a
)
testsuite/tests/deriving/should_compile/Roles2.stderr
0 → 100644
View file @
fd20b873
TYPE SIGNATURES
TYPE CONSTRUCTORS
T1 :: * -> *
data T1 a@R
No C type associated
RecFlag NonRecursive, Not promotable
= K1 :: forall a. (IO a) -> T1 a Stricts: _
FamilyInstance: none
T2 :: * -> *
data T2 a@R
No C type associated
RecFlag NonRecursive, Not promotable
= K2 :: forall a. (FunPtr a) -> T2 a Stricts: _
FamilyInstance: none
COERCION AXIOMS
Dependent modules: []
Dependent packages: [base, ghc-prim, integer-gmp]
==================== Typechecker ====================
testsuite/tests/deriving/should_compile/Roles3.hs
0 → 100644
View file @
fd20b873
{-# LANGUAGE TypeFamilies, MultiParamTypeClasses #-}
module
Roles3
where
class
C1
a
where
meth1
::
a
->
a
class
C2
a
b
where
meth2
::
a
~
b
=>
a
->
b
class
C3
a
b
where
type
F3
b
meth3
::
a
->
F3
b
->
F3
b
type
family
F4
a
class
C4
a
b
where
meth4
::
a
->
F4
b
->
F4
b
type
Syn1
a
=
F4
a
type
Syn2
a
=
[
a
]
\ No newline at end of file
testsuite/tests/deriving/should_compile/Roles3.stderr
0 → 100644
View file @
fd20b873
TYPE SIGNATURES
TYPE CONSTRUCTORS
C1 :: * -> Constraint
class C1 a@R
RecFlag NonRecursive
meth1 :: a -> a
C2 :: * -> * -> Constraint
class C2 a@N b@N
RecFlag NonRecursive
meth2 :: (~) * a b -> a -> b
C3 :: * -> * -> Constraint
class C3 a@R b@N
RecFlag NonRecursive
type family F3 b@N :: *
meth3 :: a -> F3 b -> F3 b
C4 :: * -> * -> Constraint
class C4 a@R b@N
RecFlag NonRecursive
meth4 :: a -> F4 b -> F4 b
F4 :: * -> *
type family F4 a@N :: *
Syn1 :: * -> *
type Syn1 a@N = F4 a
Syn2 :: * -> *
type Syn2 a@R = [a]
COERCION AXIOMS
axiom Roles3.NTCo:C1 :: C1 a = a -> a
axiom Roles3.NTCo:C2 :: C2 a b = a ~ b => a -> b
axiom Roles3.NTCo:C3 :: C3 a b = a -> F3 b -> F3 b
axiom Roles3.NTCo:C4 :: C4 a b = a -> F4 b -> F4 b
Dependent modules: []
Dependent packages: [base, ghc-prim, integer-gmp]
==================== Typechecker ====================
testsuite/tests/deriving/should_compile/Roles4.hs
0 → 100644
View file @
fd20b873
{-# LANGUAGE RoleAnnotations #-}
module
Roles4
where
class
C1
a
@
N
where
meth1
::
a
->
a
class
C2
a
@
R
where
meth2
::
a
->
a
type
Syn1
a
@
N
=
[
a
]
class
C3
a
where
meth3
::
a
->
Syn1
a
testsuite/tests/deriving/should_compile/Roles4.stderr
0 → 100644
View file @
fd20b873
TYPE SIGNATURES
TYPE CONSTRUCTORS
C1 :: * -> Constraint
class C1 a@N
RecFlag NonRecursive
meth1 :: a -> a
C2 :: * -> Constraint
class C2 a@R
RecFlag NonRecursive
meth2 :: a -> a
C3 :: * -> Constraint
class C3 a@N
RecFlag NonRecursive
meth3 :: a -> Syn1 a
Syn1 :: * -> *
type Syn1 a@N = [a]
COERCION AXIOMS
axiom Roles4.NTCo:C1 :: C1 a = a -> a
axiom Roles4.NTCo:C2 :: C2 a = a -> a
axiom Roles4.NTCo:C3 :: C3 a = a -> Syn1 a
Dependent modules: []
Dependent packages: [base, ghc-prim, integer-gmp]
==================== Typechecker ====================
testsuite/tests/deriving/should_compile/all.T
View file @
fd20b873
...
@@ -39,4 +39,10 @@ test('T1133',
...
@@ -39,4 +39,10 @@ test('T1133',
test
('
T7704
',
normal
,
compile
,
[''])
test
('
T7704
',
normal
,
compile
,
[''])
test
('
T7710
',
normal
,
compile
,
[''])
test
('
T7710
',
normal
,
compile
,
[''])
test
('
AutoDeriveTypeable
',
normal
,
compile
,
[''])
test
('
AutoDeriveTypeable
',
normal
,
compile
,
[''])
\ No newline at end of file
test
('
Roles1
',
only_ways
('
normal
'),
compile
,
['
-ddump-tc
'])
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
'])
\ No newline at end of file
testsuite/tests/deriving/should_fail/Makefile
View file @
fd20b873
...
@@ -6,8 +6,11 @@ drvfail016:
...
@@ -6,8 +6,11 @@ drvfail016:
$(RM)
-f
drvfail016.hi-boot drvfail016.o-boot
$(RM)
-f
drvfail016.hi-boot drvfail016.o-boot
'
$(TEST_HC)
'
$(TEST_HC_OPTS)
-XGeneralizedNewtypeDeriving
-c
drvfail016.hs-boot
;
echo
$$
?
'
$(TEST_HC)
'
$(TEST_HC_OPTS)
-XGeneralizedNewtypeDeriving
-c
drvfail016.hs-boot
;
echo
$$
?
.PHONY
:
T1133A
.PHONY
:
T1133A
Roles12
T1133A
:
T1133A
:
'
$(TEST_HC)
'
$(TEST_HC_OPTS)
-c
T1133A.hs-boot
'
$(TEST_HC)
'
$(TEST_HC_OPTS)
-c
T1133A.hs-boot
-
'
$(TEST_HC)
'
$(TEST_HC_OPTS)
-c
T1133A.hs
-
'
$(TEST_HC)
'
$(TEST_HC_OPTS)
-c
T1133A.hs
Roles12
:
'
$(TEST_HC)
'
$(TEST_HC_OPTS)
-c
Roles12.hs-boot
-
'
$(TEST_HC)
'
$(TEST_HC_OPTS)
-c
Roles12.hs
testsuite/tests/deriving/should_fail/Roles10.hs
0 → 100644
View file @
fd20b873
{-# LANGUAGE GeneralizedNewtypeDeriving, TypeFamilies #-}
module
Roles10
where
type
family
F
a
type
instance
F
Int
=
Bool
type
instance
F
Age
=
Char
class
C
a
where
meth
::
a
->
F
a
instance
C
Int
where
meth
=
(
>
0
)
newtype
Age
=
MkAge
Int
deriving
C
\ No newline at end of file
testsuite/tests/deriving/should_fail/Roles10.stderr
0 → 100644
View file @
fd20b873
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 N
In the newtype declaration for ‛Age’
testsuite/tests/deriving/should_fail/Roles11.hs
0 → 100644
View file @
fd20b873
{-# LANGUAGE GADTs, RoleAnnotations #-}
module
Roles11
where
data
T2
a
@
R
where
K2
::
T2
Int
testsuite/tests/deriving/should_fail/Roles11.stderr
0 → 100644
View file @
fd20b873
Roles11.hs:5:1:
Role mismatch on variable a:
Annotation says R but role N is required
In the data declaration for ‛T2’
testsuite/tests/deriving/should_fail/Roles12.hs
0 → 100644
View file @
fd20b873
module
Roles12
where
import
{-#
SOURCE
#-
}
Roles12
data
T
a
testsuite/tests/deriving/should_fail/Roles12.hs-boot
0 → 100644
View file @
fd20b873
module
Roles12
where
data
T
a
\ No newline at end of file
testsuite/tests/deriving/should_fail/Roles12.stderr
0 → 100644
View file @
fd20b873
Roles12.hs:5:6:
Type constructor ‛T’ has conflicting definitions in the module and its hs-boot file
Main module: data T a@P
No C type associated
RecFlag Recursive, Promotable
=
FamilyInstance: none
Boot file: abstract(False) T a@R
No C type associated
RecFlag NonRecursive, Not promotable
FamilyInstance: none
testsuite/tests/deriving/should_fail/Roles5.hs
0 → 100644
View file @
fd20b873
module
Roles5
where
data
T
a
@
N
class
C
a
@
R
type
S
a
@
P
=
Int
\ No newline at end of file
testsuite/tests/deriving/should_fail/Roles5.stderr
0 → 100644
View file @
fd20b873
Roles5.hs:3:8:
Illegal role annotation
Perhaps you intended to use -XRoleAnnotations
In the data type declaration for ‛T’
Roles5.hs:4:9:
Illegal role annotation
Perhaps you intended to use -XRoleAnnotations
In the declaration for class C
Roles5.hs:5:8:
Illegal role annotation
Perhaps you intended to use -XRoleAnnotations
In the declaration for type synonym ‛S’
testsuite/tests/deriving/should_fail/Roles6.hs
0 → 100644
View file @
fd20b873
{-# LANGUAGE RoleAnnotations, TypeFamilies #-}
module
Roles6
where
type
family
F
a
@
R
testsuite/tests/deriving/should_fail/Roles6.stderr
0 → 100644
View file @
fd20b873
Roles6.hs:5:1:
Illegal role annotation on variable a;
role annotations are not allowed here
In the family declaration for ‛F’
testsuite/tests/deriving/should_fail/Roles7.hs
0 → 100644
View file @
fd20b873
{-# LANGUAGE RoleAnnotations #-}
module
Roles7
where
bar
::
Int
@
P
->
Int
bar
=
id
\ No newline at end of file
testsuite/tests/deriving/should_fail/Roles7.stderr
0 → 100644
View file @
fd20b873
Roles7.hs:5:8:
Illegal role annotation on Int
In the type signature for ‛bar’
testsuite/tests/deriving/should_fail/Roles8.hs
0 → 100644
View file @
fd20b873
{-# LANGUAGE RoleAnnotations, GADTs #-}
module
Roles8
where
data
T1
a
@
P
=
K1
a
testsuite/tests/deriving/should_fail/Roles8.stderr
0 → 100644
View file @
fd20b873
Roles8.hs:5:1:
Role mismatch on variable a:
Annotation says P but role R is required
In the data declaration for ‛T1’
testsuite/tests/deriving/should_fail/Roles9.hs
0 → 100644
View file @
fd20b873
{-# LANGUAGE GeneralizedNewtypeDeriving, RoleAnnotations #-}
module
Roles9
where
class
C
a
@
N
where
meth
::
a
->
a
instance
C
Int
where
meth
=
(
+
1
)
newtype
Age
=
MkAge
Int
deriving
C
testsuite/tests/deriving/should_fail/Roles9.stderr
0 → 100644
View file @
fd20b873
Roles9.hs:12: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 N
In the newtype declaration for ‛Age’
testsuite/tests/deriving/should_fail/T1496.hs
0 → 100644
View file @
fd20b873
{-# LANGUAGE TypeFamilies, GeneralizedNewtypeDeriving #-}
module
T1496
where
data
family
Z
::
*
->
*
newtype
instance
Z
Int
=
ZI
Double
newtype
instance
Z
Moo
=
ZM
(
Int
,
Int
)
newtype
Moo
=
Moo
Int
deriving
(
IsInt
)
class
IsInt
t
where
isInt
::
c
Int
->
c
t
instance
IsInt
Int
where
isInt
=
id
main
=
case
isInt
(
ZI
4.0
)
of
ZM
tu
->
print
tu
\ No newline at end of file
testsuite/tests/deriving/should_fail/T1496.stderr
0 → 100644
View file @
fd20b873
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 N
In the newtype declaration for ‛Moo’
testsuite/tests/deriving/should_fail/T2721.stderr
View file @
fd20b873
...
@@ -3,4 +3,6 @@ T2721.hs:15:28:
...
@@ -3,4 +3,6 @@ T2721.hs:15:28:
Can't make a derived instance of ‛C N’
Can't make a derived instance of ‛C N’
(even with cunning newtype deriving):
(even with cunning newtype deriving):
the class has associated types
the class has associated types
it is not type-safe to use GeneralizedNewtypeDeriving on this class;
the last parameter of ‛C’ is at role N
In the newtype declaration for ‛N’
In the newtype declaration for ‛N’
testsuite/tests/deriving/should_fail/T4846.hs
0 → 100755
View file @
fd20b873
{-# LANGUAGE RankNTypes, ScopedTypeVariables, StandaloneDeriving, GADTs, GeneralizedNewtypeDeriving, DeriveDataTypeable #-}
module
Main
where
import
Data.Typeable
data
Expr
a
where
Lit
::
Typeable
a
=>
a
->
Expr
a
class
A
a
where
mk
::
a
class
(
Typeable
a
,
A
a
)
=>
B
a
where
mkExpr
::
Expr
a
mkExpr
=
Lit
mk
-- dfunAE
instance
B
a
=>
A
(
Expr
a
)
where
mk
=
mkExpr
-- dfunAB
instance
A
Bool
where
mk
=
True
newtype
BOOL
=
BOOL
Bool
deriving
(
Typeable
,
A
)
instance
B
Bool
deriving
instance
B
BOOL
--dfunBB
showType
::
forall
a
.
Expr
a
->
String
showType
(
Lit
_
)
=
show
(
typeOf
(
undefined
::
a
))
test1
=
showType
(
mk
::
Expr
BOOL
)
-- Prints "Bool" (wrong?)
test2
=
showType
(
Lit
mk
::
Expr
BOOL
)
-- Prints "Main.BOOL" (correct)
main
=
do
{
print
test1
;
print
test2
}
testsuite/tests/deriving/should_fail/T4846.stderr
0 → 100644
View file @
fd20b873
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 N
In the stand-alone deriving instance for ‛B BOOL’
testsuite/tests/deriving/should_fail/T7148.hs
0 → 100644
View file @
fd20b873
{-# LANGUAGE GeneralizedNewtypeDeriving, GADTs #-}
module
T7148
where
data
SameType
a
b
where
Refl
::
SameType
a
a
coerce
::
SameType
a
b
->
a
->
b
coerce
Refl
=
id
trans
::
SameType
a
b
->
SameType
b
c
->
SameType
a
c
trans
Refl
Refl
=
Refl
sameUnit
::
SameType
()
()
sameUnit
=
Refl
class
IsoUnit
a
where
iso1
::
SameType
()
b
->
SameType
a
b
iso2
::
SameType
b
()
->
SameType
b
a
instance
IsoUnit
()
where
iso1
=
id
iso2
=
id
newtype
Tagged
a
b
=
Tagged
b
deriving
IsoUnit
sameTagged
::
SameType
(
Tagged
a
b
)
(
Tagged
a'
b'
)
->
SameType
a
a'
sameTagged
Refl
=
Refl
unsafe'
::
SameType
(
Tagged
a
()
)
(
Tagged
a'
()
)
unsafe'
=
(
iso1
sameUnit
)
`
trans
`
(
iso2
sameUnit
)
unsafe
::
SameType
a
b
unsafe
=
sameTagged
unsafe'
--once again inferred type is a -> b
unsafeCoerce
=
coerce
unsafe
\ No newline at end of file
testsuite/tests/deriving/should_fail/T7148.stderr
0 → 100644
View file @
fd20b873
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 N
In the newtype declaration for ‛Tagged’
testsuite/tests/deriving/should_fail/T7148a.hs
0 → 100644
View file @
fd20b873
{-# LANGUAGE TypeFamilies, ScopedTypeVariables,
GeneralizedNewtypeDeriving #-}
module
T7148a
where
import
Control.Monad.ST
data
Proxy
a
=
Proxy
type
family
Result
a
b
class
Convert
a
where
coerce
::
Proxy
b
->
a
->
Result
a
b
newtype
SAFE
a
=
SAFE
a
type
instance
Result
(
SAFE
a
)
b
=
a
instance
Convert
(
SAFE
a
)
where
coerce
_
(
SAFE
a
)
=
a
newtype
IS_NO_LONGER
a
=
IS_NO_LONGER
a
deriving
Convert
type
instance
Result
(
IS_NO_LONGER
a
)
b
=
b
--infered type is
unsafeCoerce
::
forall
a
b
.
a
->
b
unsafeCoerce
=
coerce
(
Proxy
::
Proxy
b
)
.
IS_NO_LONGER
.
SAFE
--use it safely
id'
::
a
->
a
id'
=
unsafeCoerce
--segfault (with high probability)
crash
::
segfault
crash
=
unsafeCoerce
.
tail
.
tail
.
tail
.
unsafeCoerce
$
True
--time for side effects
unsafePerformIO
::
IO
a
->
a
unsafePerformIO
x
=
runST
$
unsafeCoerce
x
\ No newline at end of file
testsuite/tests/deriving/should_fail/T7148a.stderr
0 → 100644
View file @
fd20b873
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 N
In the newtype declaration for ‛IS_NO_LONGER’
testsuite/tests/deriving/should_fail/all.T
View file @
fd20b873
...
@@ -41,3 +41,18 @@ test('T1133A',
...
@@ -41,3 +41,18 @@ test('T1133A',
['
$MAKE --no-print-directory -s T1133A
'])
['
$MAKE --no-print-directory -s T1133A
'])
test
('
T5863a
',
normal
,
compile_fail
,
[''])
test
('
T5863a
',
normal
,
compile_fail
,
[''])