Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Alfredo Di Napoli
GHC
Commits
12515187
Commit
12515187
authored
Feb 12, 2016
by
Simon Peyton Jones
Browse files
Beef up tc124
Makes it a slightly more stringent test of record pattern bindings
parent
c6485d5e
Changes
1
Hide whitespace changes
Inline
Side-by-side
testsuite/tests/typecheck/should_compile/tc124.hs
View file @
12515187
...
...
@@ -7,13 +7,19 @@
module
Foo
where
data
T
=
T
{
t1
::
forall
a
.
a
->
a
,
t2
::
forall
a
b
.
a
->
b
->
b
}
data
T
=
T
{
t1
::
forall
a
.
a
->
a
,
t2
::
forall
b
c
.
b
->
c
->
c
}
-- Test pattern bindings for polymorphic fields
f
::
T
->
(
Int
,
Char
)
f
t
=
let
T
{
t1
=
my_t1
}
=
t
f
::
T
->
(
Int
,
Char
,
Char
)
f
t
=
let
T
{
t1
=
my_t1
,
t2
=
my_t2
}
=
t
in
(
my_t1
3
,
my_t1
'c'
)
(
my_t1
3
,
my_t1
'c'
,
my_t2
2
'c'
)
f2
::
T
->
(
Int
,
Char
,
Char
)
f2
t
=
let
T
{
t1
=
my_t1
,
t2
=
my_t2
}
=
t
in
(
my_t1
3
,
my_t1
'c'
,
my_t2
2
'c'
)
-- Test record update with polymorphic fields
g
::
T
->
T
...
...
Write
Preview
Supports
Markdown
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