new tester; all tests categorized
This commit is contained in:
parent
51ee524109
commit
20b5f31c03
481 changed files with 794 additions and 2506 deletions
19
tests/template/ttempl2.nim
Normal file
19
tests/template/ttempl2.nim
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
discard """
|
||||
file: "ttempl2.nim"
|
||||
line: 18
|
||||
errormsg: "undeclared identifier: \'b\'"
|
||||
"""
|
||||
template declareInScope(x: expr, t: typeDesc): stmt {.immediate.} =
|
||||
var x: t
|
||||
|
||||
template declareInNewScope(x: expr, t: typeDesc): stmt {.immediate.} =
|
||||
# open a new scope:
|
||||
block:
|
||||
var x: t
|
||||
|
||||
declareInScope(a, int)
|
||||
a = 42 # works, `a` is known here
|
||||
|
||||
declareInNewScope(b, int)
|
||||
b = 42 #ERROR_MSG undeclared identifier: 'b'
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue