parent
0327159344
commit
32f335f594
2 changed files with 9 additions and 1 deletions
|
|
@ -1841,7 +1841,8 @@ proc isInfixAs*(n: PNode): bool =
|
||||||
return n.kind == nkInfix and n[0].kind == nkIdent and n[0].ident.s == "as"
|
return n.kind == nkInfix and n[0].kind == nkIdent and n[0].ident.s == "as"
|
||||||
|
|
||||||
proc findUnresolvedStatic*(n: PNode): PNode =
|
proc findUnresolvedStatic*(n: PNode): PNode =
|
||||||
if n.kind == nkSym and n.typ.kind == tyStatic and n.typ.n == nil:
|
# n.typ == nil: see issue #14802
|
||||||
|
if n.kind == nkSym and n.typ != nil and n.typ.kind == tyStatic and n.typ.n == nil:
|
||||||
return n
|
return n
|
||||||
|
|
||||||
for son in n:
|
for son in n:
|
||||||
|
|
|
||||||
|
|
@ -216,3 +216,10 @@ block: # #12713
|
||||||
proc test(c: static string) = discard #Remove this and it compiles
|
proc test(c: static string) = discard #Remove this and it compiles
|
||||||
proc test(c: Cell) = discard
|
proc test(c: Cell) = discard
|
||||||
test Cell()
|
test Cell()
|
||||||
|
|
||||||
|
block: # issue #14802
|
||||||
|
template fn(s: typed): untyped =
|
||||||
|
proc bar() = discard
|
||||||
|
12
|
||||||
|
const myConst = static(fn(1))
|
||||||
|
doAssert myConst == 12
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue