version 0.7.6
This commit is contained in:
parent
e792940f52
commit
08bc9ac03c
29 changed files with 5926 additions and 0 deletions
14
tests/ttempl2.nim
Normal file
14
tests/ttempl2.nim
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
template declareInScope(x: expr, t: typeDesc): stmt =
|
||||
var x: t
|
||||
|
||||
template declareInNewScope(x: expr, t: typeDesc): stmt =
|
||||
# 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