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,324
Issues
4,324
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
385
Merge Requests
385
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
26ea1e82
Commit
26ea1e82
authored
May 04, 2011
by
dreixel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adapt the testsuite to the recent ghc-generics changes.
parent
92af8175
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
69 additions
and
19 deletions
+69
-19
testsuite/tests/ghc-regress/generics/CanDoRep0.hs
testsuite/tests/ghc-regress/generics/CanDoRep0.hs
+23
-0
testsuite/tests/ghc-regress/generics/CannotDoRep0.hs
testsuite/tests/ghc-regress/generics/CannotDoRep0.hs
+1
-1
testsuite/tests/ghc-regress/generics/CannotDoRep0.stderr
testsuite/tests/ghc-regress/generics/CannotDoRep0.stderr
+1
-1
testsuite/tests/ghc-regress/generics/CannotDoRep1.hs
testsuite/tests/ghc-regress/generics/CannotDoRep1.hs
+1
-1
testsuite/tests/ghc-regress/generics/CannotDoRep1.stderr
testsuite/tests/ghc-regress/generics/CannotDoRep1.stderr
+1
-1
testsuite/tests/ghc-regress/generics/CannotDoRep2.hs
testsuite/tests/ghc-regress/generics/CannotDoRep2.hs
+1
-1
testsuite/tests/ghc-regress/generics/CannotDoRep2.stderr
testsuite/tests/ghc-regress/generics/CannotDoRep2.stderr
+1
-1
testsuite/tests/ghc-regress/generics/GEq/GEq.hs
testsuite/tests/ghc-regress/generics/GEq/GEq.hs
+1
-4
testsuite/tests/ghc-regress/generics/GEq/GEq1.stdout
testsuite/tests/ghc-regress/generics/GEq/GEq1.stdout
+1
-0
testsuite/tests/ghc-regress/generics/GEq/Main.hs
testsuite/tests/ghc-regress/generics/GEq/Main.hs
+13
-3
testsuite/tests/ghc-regress/generics/ShouldFail0.hs
testsuite/tests/ghc-regress/generics/ShouldFail0.hs
+11
-0
testsuite/tests/ghc-regress/generics/ShouldFail0.stderr
testsuite/tests/ghc-regress/generics/ShouldFail0.stderr
+7
-0
testsuite/tests/ghc-regress/generics/Uniplate/Main.hs
testsuite/tests/ghc-regress/generics/Uniplate/Main.hs
+2
-2
testsuite/tests/ghc-regress/generics/all.T
testsuite/tests/ghc-regress/generics/all.T
+5
-4
No files found.
testsuite/tests/ghc-regress/generics/
c
anDoRep0.hs
→
testsuite/tests/ghc-regress/generics/
C
anDoRep0.hs
View file @
26ea1e82
{-# LANGUAGE Generics #-}
{-# LANGUAGE Generics #-}
{-# LANGUAGE TypeOperators #-}
module
CanDoRep0
where
import
GHC.Generics
(
Representable0
)
module
ShouldCompile0
where
-- We should be able to generate a generic representation for these types
data
A
data
A
deriving
Representable0
data
B
a
deriving
Representable0
data
C
=
C0
|
C1
deriving
Representable0
data
D
a
=
D0
|
D1
{
d11
::
a
,
d12
::
(
D
a
)
}
deriving
Representable0
data
E
a
=
E0
a
(
E
a
)
(
D
a
)
-- We do not support datatype contexts, but this should still compile
-- (Context will simply have no Representable0 instance)
data
(
Show
a
)
=>
Context
a
=
Context
a
data
(
:*:
)
a
b
=
a
:*:
b
deriving
Representable0
testsuite/tests/ghc-regress/generics/
c
annotDoRep0.hs
→
testsuite/tests/ghc-regress/generics/
C
annotDoRep0.hs
View file @
26ea1e82
{-# LANGUAGE DeriveRepresentable #-}
{-# LANGUAGE ExistentialQuantification #-}
module
ShouldFail
0
where
module
CannotDoRep
0
where
import
GHC.Generics
...
...
testsuite/tests/ghc-regress/generics/
c
annotDoRep0.stderr
→
testsuite/tests/ghc-regress/generics/
C
annotDoRep0.stderr
View file @
26ea1e82
c
annotDoRep0.hs:9:45:
C
annotDoRep0.hs:9:45:
Can't make a derived instance of `Representable0 Dynamic':
Cannot derive Representable for type Dynamic
In the data type declaration for `Dynamic'
testsuite/tests/ghc-regress/generics/
c
annotDoRep1.hs
→
testsuite/tests/ghc-regress/generics/
C
annotDoRep1.hs
View file @
26ea1e82
{-# LANGUAGE DeriveRepresentable #-}
module
ShouldFail
1
where
module
CannotDoRep
1
where
import
GHC.Generics
...
...
testsuite/tests/ghc-regress/generics/
c
annotDoRep1.stderr
→
testsuite/tests/ghc-regress/generics/
C
annotDoRep1.stderr
View file @
26ea1e82
c
annotDoRep1.hs:8:49:
C
annotDoRep1.hs:8:49:
Can't make a derived instance of `Representable0 (Context a)':
Cannot derive Representable for type Context
In the data type declaration for `Context'
testsuite/tests/ghc-regress/generics/
c
annotDoRep2.hs
→
testsuite/tests/ghc-regress/generics/
C
annotDoRep2.hs
View file @
26ea1e82
...
...
@@ -2,7 +2,7 @@
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE GADTs #-}
module
ShouldFail
2
where
module
CannotDoRep
2
where
import
GHC.Generics
...
...
testsuite/tests/ghc-regress/generics/
c
annotDoRep2.stderr
→
testsuite/tests/ghc-regress/generics/
C
annotDoRep2.stderr
View file @
26ea1e82
c
annotDoRep2.hs:13:1:
C
annotDoRep2.hs:13:1:
Can't make a derived instance of `Representable0 (Term a)':
Cannot derive Representable for type Term
In the stand-alone deriving instance for `Representable0 (Term a)'
testsuite/tests/ghc-regress/generics/GEq/GEq.hs
View file @
26ea1e82
...
...
@@ -10,10 +10,7 @@ class GEq' f where
instance
GEq'
U1
where
geq'
_
_
=
True
instance
GEq'
(
K1
P
c
)
where
geq'
(
K1
a
)
(
K1
b
)
=
undefined
instance
(
GEq
c
)
=>
GEq'
(
K1
R
c
)
where
instance
(
GEq
c
)
=>
GEq'
(
K1
i
c
)
where
geq'
(
K1
a
)
(
K1
b
)
=
geq
a
b
-- No instances for P or Rec because geq is only applicable to types of kind *
...
...
testsuite/tests/ghc-regress/generics/GEq/GEq1.stdout
View file @
26ea1e82
False
False
True
True
testsuite/tests/ghc-regress/generics/GEq/Main.hs
View file @
26ea1e82
...
...
@@ -8,8 +8,13 @@ import GEq
-- We should be able to generate a generic representation for these types
data
C
=
C0
|
C1
deriving
Representable0
data
D
a
=
D0
|
D1
{
d11
::
a
,
d12
::
(
D
a
)
}
deriving
Representable0
data
(
:**:
)
a
b
=
a
:**:
b
deriving
Representable0
-- Example values
c0
=
C0
...
...
@@ -19,13 +24,18 @@ d0 :: D Char
d0
=
D0
d1
=
D1
'p'
D0
p1
::
Int
:**:
Char
p1
=
3
:**:
'p'
-- Generic instances
instance
GEq
C
instance
(
GEq
a
)
=>
GEq
(
D
a
)
instance
GEq
C
instance
(
GEq
a
)
=>
GEq
(
D
a
)
instance
(
GEq
a
,
GEq
b
)
=>
GEq
(
a
:**:
b
)
-- Tests
teq0
=
geq
c0
c1
teq1
=
geq
d0
d1
teq2
=
geq
d0
d0
teq3
=
geq
p1
p1
main
=
mapM_
print
[
teq0
,
teq1
,
teq2
]
main
=
mapM_
print
[
teq0
,
teq1
,
teq2
,
teq3
]
testsuite/tests/ghc-regress/generics/ShouldFail0.hs
0 → 100644
View file @
26ea1e82
{-# LANGUAGE StandaloneDeriving #-}
module
ShouldFail0
where
import
GHC.Generics
(
Representable0
)
data
X
=
X
deriving
instance
Representable0
X
-- Should fail (no XDeriveRepresentable)
testsuite/tests/ghc-regress/generics/ShouldFail0.stderr
0 → 100644
View file @
26ea1e82
ShouldFail0.hs:9:1:
Can't make a derived instance of `Representable0 X':
You need -XDeriveRepresentable to derive an instance for this class
or
You need -XGenerics to derive an instance for this class
In the stand-alone deriving instance for `Representable0 X'
testsuite/tests/ghc-regress/generics/Uniplate/Main.hs
View file @
26ea1e82
...
...
@@ -6,8 +6,8 @@ import GHC.Generics
import
Uniplate
data
Tree
=
Leaf
|
Node
Int
Tree
Tree
deriving
Show
data
Pair
a
b
=
Pair
a
b
deriving
Show
data
Tree
=
Leaf
|
Node
Int
Tree
Tree
deriving
(
Show
,
Representable0
)
data
Pair
a
b
=
Pair
a
b
deriving
(
Show
,
Representable0
)
instance
Uniplate
Tree
instance
Uniplate
(
Pair
a
b
)
...
...
testsuite/tests/ghc-regress/generics/all.T
View file @
26ea1e82
setTestOpts
(
only_compiler_types
(['
ghc
']))
test
('
c
anDoRep0
',
normal
,
compile
,
[''])
test
('
C
anDoRep0
',
normal
,
compile
,
[''])
test
('
cannotDoRep0
',
normal
,
compile_fail
,
[''])
test
('
cannotDoRep1
',
normal
,
compile_fail
,
[''])
test
('
cannotDoRep2
',
normal
,
compile_fail
,
[''])
test
('
ShouldFail0
',
normal
,
compile_fail
,
[''])
test
('
CannotDoRep0
',
normal
,
compile_fail
,
[''])
test
('
CannotDoRep1
',
normal
,
compile_fail
,
[''])
test
('
CannotDoRep2
',
normal
,
compile_fail
,
[''])
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment