mirror of
https://github.com/nim-lang/Nim.git
synced 2026-06-06 03:44:14 +00:00
Add test for #1259
This commit is contained in:
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
|
||||
Reference in New Issue
Block a user