bugfix: bind context for generics
This commit is contained in:
parent
583e036bbd
commit
09a4c2f0ad
1 changed files with 3 additions and 3 deletions
|
|
@ -68,14 +68,14 @@ proc semGenericStmt(c: PContext, n: PNode,
|
||||||
result = n
|
result = n
|
||||||
if gCmd == cmdIdeTools: suggestStmt(c, n)
|
if gCmd == cmdIdeTools: suggestStmt(c, n)
|
||||||
case n.kind
|
case n.kind
|
||||||
of nkIdent:
|
of nkIdent, nkAccQuoted:
|
||||||
var s = SymtabGet(c.Tab, n.ident)
|
var s = SymtabGet(c.Tab, n.ident)
|
||||||
if s == nil:
|
if s == nil:
|
||||||
# no error if symbol cannot be bound, unless in ``bind`` context:
|
# no error if symbol cannot be bound, unless in ``bind`` context:
|
||||||
if withinBind in flags:
|
if withinBind in flags:
|
||||||
localError(n.info, errUndeclaredIdentifier, n.ident.s)
|
localError(n.info, errUndeclaredIdentifier, n.ident.s)
|
||||||
else:
|
else:
|
||||||
if withinBind in flags or s.name.id in toBind: result = symChoice(c, n, s)
|
if withinBind in flags or s.id in toBind: result = symChoice(c, n, s)
|
||||||
else: result = semGenericStmtSymbol(c, n, s)
|
else: result = semGenericStmtSymbol(c, n, s)
|
||||||
of nkDotExpr:
|
of nkDotExpr:
|
||||||
var s = QualifiedLookUp(c, n, {})
|
var s = QualifiedLookUp(c, n, {})
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue