tscope.nim 269 B

12345678910111213
  1. discard """
  2. errormsg: "redefinition of 'x'"
  3. """
  4. var x = 1
  5. template quantity() =
  6. # Causes internal error in compiler/sem.nim
  7. proc unit*(x = 1.0): float = 12
  8. # Throws the correct error: redefinition of 'x'
  9. #proc unit*(y = 1.0): float = 12
  10. quantity()
  11. var x = 2