diff options
author | Adam Chlipala <adamc@hcoop.net> | 2008-07-31 13:08:57 -0400 |
---|---|---|
committer | Adam Chlipala <adamc@hcoop.net> | 2008-07-31 13:08:57 -0400 |
commit | d668886a45158cf3a292fdef3fa81498efd77652 (patch) | |
tree | 8b94f33c7f9d49dfb2a8b7b65cee62097fcf9630 /tests | |
parent | 183c43eb783edd68f76f941fa61b6ef1f8752a56 (diff) |
Elaborating record patterns
Diffstat (limited to 'tests')
-rw-r--r-- | tests/rpat.lac | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/rpat.lac b/tests/rpat.lac new file mode 100644 index 00000000..6c4f9c5e --- /dev/null +++ b/tests/rpat.lac @@ -0,0 +1,13 @@ +val f = fn x : {A : int} => case x of {A = _} => 0 +val f = fn x : {A : int} => case x of {A = _, ...} => 0 +val f = fn x : {A : int, B : int} => case x of {A = _, ...} => 0 +val f = fn x : {A : int, B : int} => case x of {A = 1, B = 2} => 0 | {A = _, ...} => 1 + +datatype t = A | B + +val f = fn x => case x of {A = A, B = 2} => 0 | {A = A, ...} => 0 | {A = B, ...} => 0 + +val f = fn x => case x of {A = {A = A, ...}, B = B} => 0 + | {B = A, ...} => 1 + | {A = {A = B, B = A}, B = B} => 2 + | {A = {A = B, B = B}, B = B} => 3 |