summary refs log tree commit diff stats
path: root/tests/template/tscope.nim
blob: 1eeebbdd4aa37e5449ff56c45b70fb10f6901d92 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
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