From 3dfb4891c77f03b038f6f65c750460c4fc882c7f Mon Sep 17 00:00:00 2001 From: Araq Date: Wed, 5 Mar 2014 08:47:27 +0100 Subject: [PATCH] bugfix: unreported 'compiles' bug --- compiler/lookups.nim | 2 +- tests/compiles/tcompiles.nim | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/compiler/lookups.nim b/compiler/lookups.nim index 93a7b7c722..fcb5b67314 100644 --- a/compiler/lookups.nim +++ b/compiler/lookups.nim @@ -92,7 +92,7 @@ proc errorSym*(c: PContext, n: PNode): PSym = result.typ = errorType(c) incl(result.flags, sfDiscardable) # pretend it's imported from some unknown module to prevent cascading errors: - if gCmd != cmdInteractive: + if gCmd != cmdInteractive and c.inCompilesContext == 0: c.importTable.addSym(result) type diff --git a/tests/compiles/tcompiles.nim b/tests/compiles/tcompiles.nim index d0fccdaff8..b3d9c17ce7 100644 --- a/tests/compiles/tcompiles.nim +++ b/tests/compiles/tcompiles.nim @@ -24,3 +24,5 @@ ok supports(`+`, 34) no compiles(4+5.0 * "hallo") +no compiles(undeclaredIdentifier) +no compiles(undeclaredIdentifier)