mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-29 01:14:41 +00:00
13 lines
289 B
Nim
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
|