diff options
author | def <dennis@felsin9.de> | 2015-02-04 19:53:50 +0100 |
---|---|---|
committer | def <dennis@felsin9.de> | 2015-02-04 19:53:50 +0100 |
commit | 69b794cd7dcfe553ab19ad78630d0b237c096050 (patch) | |
tree | aa08dc9e455cef770656d4be69964eb3828dc6de /tests/template | |
parent | d91368c8d0602b343546e16c26c8ad297d48d188 (diff) | |
download | Nim-69b794cd7dcfe553ab19ad78630d0b237c096050.tar.gz |
Add test for #1259
Diffstat (limited to 'tests/template')
-rw-r--r-- | tests/template/tscope.nim | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/template/tscope.nim b/tests/template/tscope.nim new file mode 100644 index 000000000..2d5841af3 --- /dev/null +++ b/tests/template/tscope.nim @@ -0,0 +1,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 |