Commit 12515187 authored by Simon Peyton Jones's avatar Simon Peyton Jones

Beef up tc124

Makes it a slightly more stringent test of record pattern bindings
parent c6485d5e
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment