mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-18 13:30:33 +00:00
handle in semConst
This commit is contained in:
@@ -2708,7 +2708,6 @@ proc expr(p: BProc, n: PNode, d: var TLoc) =
|
||||
inc p.splitDecls
|
||||
genGotoState(p, n)
|
||||
of nkBreakState: genBreakState(p, n, d)
|
||||
of nkExprColonExpr: expr(p, n.sons[1], d)
|
||||
else: internalError(p.config, n.info, "expr(" & $n.kind & "); unknown node kind")
|
||||
|
||||
proc genNamedConstExpr(p: BProc, n: PNode): Rope =
|
||||
|
||||
@@ -2503,7 +2503,6 @@ 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 =
|
||||
|
||||
@@ -641,7 +641,8 @@ proc semConst(c: PContext, n: PNode): PNode =
|
||||
addSon(b, copyTree(def))
|
||||
else:
|
||||
setVarType(c, v, typ.sons[j])
|
||||
v.ast = def[j]
|
||||
v.ast = if def[j].kind != nkExprColonExpr: def[j]
|
||||
else: def[j].sons[1]
|
||||
b.sons[j] = newSymNode(v)
|
||||
addSon(result,b)
|
||||
dec c.inStaticContext
|
||||
|
||||
Reference in New Issue
Block a user