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