summaryrefslogtreecommitdiff
path: root/testsuite/tests/deSugar/should_run/dsrun003.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/deSugar/should_run/dsrun003.hs')
-rw-r--r--testsuite/tests/deSugar/should_run/dsrun003.hs13
1 files changed, 13 insertions, 0 deletions
diff --git a/testsuite/tests/deSugar/should_run/dsrun003.hs b/testsuite/tests/deSugar/should_run/dsrun003.hs
new file mode 100644
index 0000000000..d100bff718
--- /dev/null
+++ b/testsuite/tests/deSugar/should_run/dsrun003.hs
@@ -0,0 +1,13 @@
+-- Tests match on empty field lists
+
+module Main where
+
+data Person = Female {firstName, lastName :: String}
+ | Male {firstName, lastName :: String}
+ deriving (Show)
+
+isFemale (Female{}) = True
+isFemale (Male{}) = False
+
+main = print (isFemale (Female {firstName = "Jane", lastName = "Smith"}))
+