mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-27 01:34:02 +00:00
fixes #3158
This commit is contained in:
20
tests/template/twrongsymkind.nim
Normal file
20
tests/template/twrongsymkind.nim
Normal file
@@ -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)
|
||||
Reference in New Issue
Block a user