Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make var, let work in static, const sections #18637

Closed
Prev Previous commit
Next Next commit
works
  • Loading branch information
timotheecour committed Aug 3, 2021
commit fc33300343907108098152f13115be3a86da59b6
11 changes: 6 additions & 5 deletions compiler/semstmts.nim
Original file line number Diff line number Diff line change
Expand Up @@ -674,14 +674,15 @@ proc semConst(c: PContext, n: PNode): PNode =
# don't evaluate here since the type compatibility check below may add a converter
# var def = semExprWithType(c, a[^1])
var def = a[^1]
# if c.config.isDefined("nimAfterSystem"):
if true:
if c.config.isDefined("nimAfterSystem"):
# if true:
var c2 = GenContext(cache: c.cache, info: def.info)
def = genPNode(c2, def):
block:
proc zoo_xy(): auto =
def
zoo_xy()
(proc(): auto = def)()
# proc zoo_xy(): auto =
# def
# zoo_xy()
# n = genPNode(c2, n):
# (proc(): auto =
# n)()
Expand Down