diff options
author | Araq <rumpf_a@web.de> | 2015-08-02 01:17:23 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2015-08-02 02:56:00 +0200 |
commit | 41e8c9b9acc16f65166648aaba38408dad42e7bc (patch) | |
tree | ad2c09fce6777e7dcb4759a783036e3e02f7e286 /tests/template | |
parent | 5e325bc9f9be68841ce1aef6b64aada2aeb52918 (diff) | |
download | Nim-41e8c9b9acc16f65166648aaba38408dad42e7bc.tar.gz |
fixes #3158
Diffstat (limited to 'tests/template')
-rw-r--r-- | tests/template/twrongsymkind.nim | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/template/twrongsymkind.nim b/tests/template/twrongsymkind.nim new file mode 100644 index 000000000..be3d8c652 --- /dev/null +++ b/tests/template/twrongsymkind.nim @@ -0,0 +1,20 @@ +discard """ + errormsg: "cannot use symbol of kind 'var' as a 'param'" + line: 20 +""" + +# bug #3158 + +type + MyData = object + x: int + +template newDataWindow(data: ref MyData): stmt = + proc testProc(data: ref MyData) = + echo "Hello, ", data.x + testProc(data) + +var d: ref MyData +new(d) +d.x = 10 +newDataWindow(d) |