Add test for #1259
This commit is contained in:
parent
d91368c8d0
commit
69b794cd7d
1 changed files with 12 additions and 0 deletions
12
tests/template/tscope.nim
Normal file
12
tests/template/tscope.nim
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue