aboutsummaryrefslogtreecommitdiff
path: root/test/enums.tm
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-03-17 22:06:55 -0400
committerBruce Hill <bruce@bruce-hill.com>2024-03-17 22:06:55 -0400
commit6905f759e5cdbbfa7e16cf183d01ca1f8a858f71 (patch)
tree40915c44938daa8e1acec1e0ecb204fae4db97a1 /test/enums.tm
parent146d3542d5f626099f4c30a0190b6e1d963e70f4 (diff)
Empty enums use a singleton instead of a constructor
Diffstat (limited to 'test/enums.tm')
-rw-r--r--test/enums.tm6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/enums.tm b/test/enums.tm
index 6dde3601..1b02686d 100644
--- a/test/enums.tm
+++ b/test/enums.tm
@@ -1,6 +1,6 @@
enum Foo(Zero, One(x:Int), Two(x,y:Int))
->> Foo.Zero()
+>> Foo.Zero
= Foo.Zero()
>> Foo.One(123)
= Foo.One(x=123)
@@ -10,7 +10,7 @@ enum Foo(Zero, One(x:Int), Two(x,y:Int))
>> Foo.One(10) == Foo.One(10)
= yes
->> Foo.One(10) == Foo.Zero()
+>> Foo.One(10) == Foo.Zero
= no
>> Foo.One(10) == Foo.One(-1)
@@ -23,7 +23,7 @@ enum Foo(Zero, One(x:Int), Two(x,y:Int))
>> t := {x=>"found"; default="missing"}
>> t[x]
= "found"
->> t[Foo.Zero()]
+>> t[Foo.Zero]
= "missing"
when x is o:One