Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
a766958a
Commit
a766958a
authored
Feb 28, 2005
by
simonpj
Browse files
[project @ 2005-02-28 16:05:55 by simonpj]
Add test for kind errors in record update; and synonyms in iface files
parent
ced56997
Changes
3
Hide whitespace changes
Inline
Side-by-side
testsuite/tests/ghc-regress/typecheck/should_compile/all.T
View file @
a766958a
...
...
@@ -199,6 +199,8 @@ test('tc186', normal, compile, [''])
test
('
tc187
',
normal
,
compile
,
[''])
test
('
tc188
',
normal
,
compile
,
[''])
test
('
tc189
',
normal
,
compile
,
[''])
test
('
tc190
',
normal
,
compile
,
[''])
test
('
tc191
',
normal
,
compile
,
[''])
test
('
LoopOfTheDay1
',
normal
,
compile
,
[''])
test
('
LoopOfTheDay2
',
normal
,
compile
,
[''])
...
...
testsuite/tests/ghc-regress/typecheck/should_compile/tc190.hs
0 → 100644
View file @
a766958a
{-# OPTIONS -cpp -fglasgow-exts #-}
-- The record update triggered a kind error in GHC 6.2
module
Foo
where
data
HT
(
ref
::
*
->
*
)
=
HT
{
kcount
::
Int
}
set_kcount
::
Int
->
HT
s
->
HT
s
set_kcount
kc
ht
=
ht
{
kcount
=
kc
}
testsuite/tests/ghc-regress/typecheck/should_compile/tc191.hs
0 → 100644
View file @
a766958a
{-# OPTIONS -fglasgow-exts #-}
-- This only typechecks if forall-hoisting works ok when
-- importing from an interface file. The type of Twins.gzipWithQ
-- is this:
-- type GenericQ r = forall a. Data a => a -> r
-- gzipWithQ :: GenericQ (GenericQ r) -> GenericQ (GenericQ [r])
-- It's kept this way in the interface file for brevity and documentation,
-- but when the type synonym is expanded, the foralls need expanding
module
Foo
where
import
Data.Generics.Basics
import
Data.Generics.Aliases
import
Data.Generics.Twins
(
gzipWithQ
)
-- | Generic equality: an alternative to \deriving Eq\
geq
::
Data
a
=>
a
->
a
->
Bool
geq
x
y
=
geq'
x
y
where
geq'
::
forall
a
b
.
(
Data
a
,
Data
b
)
=>
a
->
b
->
Bool
geq'
x
y
=
(
toConstr
x
==
toConstr
y
)
&&
and
(
gzipWithQ
geq'
x
y
)
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