aboutsummaryrefslogtreecommitdiff
path: root/src/lux/compiler/case.clj
diff options
context:
space:
mode:
authorEduardo Julian2016-01-02 23:53:54 -0400
committerEduardo Julian2016-01-02 23:53:54 -0400
commit46a8d84e3f48396d68db2f854644b7b83c3a102c (patch)
treebe1008a696ec7fc5ba74a2901b607e078e15b58d /src/lux/compiler/case.clj
parentd7c9dcc381596e8ae1617af23ffbf71190737173 (diff)
- Switched from TupleT to ProdT (type-wise).
Diffstat (limited to '')
-rw-r--r--src/lux/compiler/case.clj8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/lux/compiler/case.clj b/src/lux/compiler/case.clj
index e0d1b886e..1a4006312 100644
--- a/src/lux/compiler/case.clj
+++ b/src/lux/compiler/case.clj
@@ -86,10 +86,16 @@
(.visitJumpInsn Opcodes/GOTO $target))
(&a-case/$TupleTestAC ?members)
- (if (&/|empty? ?members)
+ (|case ?members
+ (&/$Nil)
(doto writer
(.visitInsn Opcodes/POP)
(.visitJumpInsn Opcodes/GOTO $target))
+
+ (&/$Cons ?member (&/$Nil))
+ (compile-match ?member $target $else)
+
+ _
(doto writer
(.visitTypeInsn Opcodes/CHECKCAST "[Ljava/lang/Object;")
(-> (doto (.visitInsn Opcodes/DUP)