diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2016-02-12 13:41:39 +0000 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2016-02-12 17:37:11 +0000 |
commit | 125151870de63de4a227afc2c1e38802009bc7e5 (patch) | |
tree | 05fb4a30c10f9116b394909bc6796227d7089827 | |
parent | c6485d5e6daec20c8ff66d6e721d3e0a5f3156ac (diff) | |
download | haskell-125151870de63de4a227afc2c1e38802009bc7e5.tar.gz |
Beef up tc124
Makes it a slightly more stringent test of record pattern bindings
-rw-r--r-- | testsuite/tests/typecheck/should_compile/tc124.hs | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/testsuite/tests/typecheck/should_compile/tc124.hs b/testsuite/tests/typecheck/should_compile/tc124.hs index 658b29c3c9..a832cd3988 100644 --- a/testsuite/tests/typecheck/should_compile/tc124.hs +++ b/testsuite/tests/typecheck/should_compile/tc124.hs @@ -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 |