bugfix: bind context for generics

This commit is contained in:
Araq 2012-07-24 07:39:23 +02:00
commit 09a4c2f0ad

View file

@ -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, {})