Files
Nim/tests/template/tscope.nim
2015-02-04 19:53:50 +01:00

13 lines
289 B
Nim

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