mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-29 09:24:36 +00:00
13 lines
269 B
Nim
13 lines
269 B
Nim
discard """
|
|
errormsg: "redefinition of 'x'"
|
|
"""
|
|
|
|
var x = 1
|
|
template quantity() =
|
|
# 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
|