summary refs log blame commit diff stats
path: root/tests/template/twrongsymkind.nim
blob: 5fa6189145b49ec39d0aa0a8225d535cdf98ba05 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11










                                                          
                                                   







                                     
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): untyped =
    proc testProc(data: ref MyData) =
        echo "Hello, ", data.x
    testProc(data)

var d: ref MyData
new(d)
d.x = 10
newDataWindow(d)