summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
Diffstat (limited to 'compiler')
-rw-r--r--compiler/ccgexprs.nim2
-rw-r--r--compiler/jsgen.nim1
-rw-r--r--compiler/semfold.nim2
3 files changed, 3 insertions, 2 deletions
diff --git a/compiler/ccgexprs.nim b/compiler/ccgexprs.nim
index e03c4b1c1..4baa6795d 100644
--- a/compiler/ccgexprs.nim
+++ b/compiler/ccgexprs.nim
@@ -2850,7 +2850,7 @@ proc genConstSeqV2(p: BProc, n: PNode, t: PType): Rope =
 
 proc genConstExpr(p: BProc, n: PNode): Rope =
   case n.kind
-  of nkHiddenStdConv, nkHiddenSubConv:
+  of nkHiddenStdConv, nkHiddenSubConv, nkExprColonExpr:
     result = genConstExpr(p, n.sons[1])
   of nkCurly:
     var cs: TBitSet
diff --git a/compiler/jsgen.nim b/compiler/jsgen.nim
index cd13aab78..dc81b4e37 100644
--- a/compiler/jsgen.nim
+++ b/compiler/jsgen.nim
@@ -2503,6 +2503,7 @@ proc gen(p: PProc, n: PNode, r: var TCompRes) =
   of nkPragmaBlock: gen(p, n.lastSon, r)
   of nkComesFrom:
     discard "XXX to implement for better stack traces"
+  of nkExprColonExpr: gen(p, n.sons[1], r)
   else: internalError(p.config, n.info, "gen: unknown node type: " & $n.kind)
 
 proc newModule(g: ModuleGraph; module: PSym): BModule =
diff --git a/compiler/semfold.nim b/compiler/semfold.nim
index 3034ef9cc..5fb2fcd65 100644
--- a/compiler/semfold.nim
+++ b/compiler/semfold.nim
@@ -701,7 +701,7 @@ proc getConstExpr(m: PSym, n: PNode; g: ModuleGraph): PNode =
       for i in countup(0, sonsLen(n) - 1):
         var a = getConstExpr(m, n.sons[i].sons[1], g)
         if a == nil: return nil
-        result.sons[i] = a
+        result.sons[i].sons[1] = a
     else:
       for i in countup(0, sonsLen(n) - 1):
         var a = getConstExpr(m, n.sons[i], g)