bugfix: 'nimrod i' works again

This commit is contained in:
Araq 2012-09-18 20:59:14 +02:00
commit cb6ad8cb74
3 changed files with 10 additions and 5 deletions

View file

@ -712,13 +712,12 @@ proc semExprNoType(c: PContext, n: PNode): PNode =
sfDiscardable in n.sons[0].sym.flags
result = semExpr(c, n, {efWantStmt})
if result.typ != nil and result.typ.kind notin {tyStmt, tyEmpty}:
if gCmd == cmdInteractive:
result = buildEchoStmt(c, result)
elif result.kind == nkNilLit:
if result.kind == nkNilLit:
# XXX too much work and fixing would break bootstrapping:
#Message(n.info, warnNilStatement)
result.typ = nil
elif not ImplicitelyDiscardable(result) and result.typ.kind != tyError:
elif not ImplicitelyDiscardable(result) and result.typ.kind != tyError and
gCmd != cmdInteractive:
localError(n.info, errDiscardValue)
proc isTypeExpr(n: PNode): bool =