recursive modules are only detected to improve error messages

This commit is contained in:
Andreas Rumpf 2016-11-24 12:27:21 +01:00
commit 01ae0d28d4
12 changed files with 57 additions and 23 deletions

View file

@ -107,7 +107,7 @@ proc lookup(c: PContext, n: PNode, flags: TSemGenericFlags,
var s = searchInScopes(c, ident).skipAlias(n)
if s == nil:
if ident.id notin ctx.toMixin and withinMixin notin flags:
localError(n.info, errUndeclaredIdentifier, ident.s)
errorUndeclaredIdentifier(c, n.info, ident.s)
else:
if withinBind in flags:
result = symChoice(c, n, s, scClosed)
@ -195,7 +195,7 @@ proc semGenericStmt(c: PContext, n: PNode,
if s == nil and withinMixin notin flags and
fn.kind in {nkIdent, nkAccQuoted} and
considerQuotedIdent(fn).id notin ctx.toMixin:
localError(n.info, errUndeclaredIdentifier, fn.renderTree)
errorUndeclaredIdentifier(c, n.info, fn.renderTree)
var first = 0
var mixinContext = false