parent
c7b4639460
commit
e406e28738
4 changed files with 52 additions and 3 deletions
15
tests/lent/t17621.nim
Normal file
15
tests/lent/t17621.nim
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
discard """
|
||||
errormsg: "invalid type: 'lent Test' in this context: 'proc (self: lent Test)' for proc"
|
||||
"""
|
||||
|
||||
# bug #17621
|
||||
{.experimental: "views".}
|
||||
|
||||
type Test = ref object
|
||||
foo: int
|
||||
|
||||
proc modify(self: lent Test) =
|
||||
self.foo += 1
|
||||
|
||||
let test = Test(foo: 12)
|
||||
modify(test)
|
||||
Loading…
Add table
Add a link
Reference in a new issue