Add test for #1259

This commit is contained in:
def
2015-02-04 19:53:50 +01:00
parent d91368c8d0
commit 69b794cd7d

12
tests/template/tscope.nim Normal file
View File

@@ -0,0 +1,12 @@
discard """
errormsg: "redefinition of 'x'"
"""
var x = 1
template quantity(): stmt {.immediate.} =
# Causes internal error in compiler/sem.nim
proc unit*(x = 1.0): float = 12
# Throws the correct error: redefinition of 'x'
#proc unit*(y = 1.0): float = 12
quantity()
var x = 2