summary refs log tree commit diff stats
path: root/compiler/semexprs.nim
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/semexprs.nim')
-rw-r--r--compiler/semexprs.nim1
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim
index c1365a83d..e32e08d4b 100644
--- a/compiler/semexprs.nim
+++ b/compiler/semexprs.nim
@@ -2364,6 +2364,7 @@ proc semWhen(c: PContext, n: PNode, semCheck = true): PNode =
           discard
         elif e.intVal != 0 and result == nil:
           setResult(it[1])
+          return # we're not in nimvm and we already have a result
     of nkElse, nkElseExpr:
       checkSonsLen(it, 1, c.config)
       if result == nil or whenNimvm: