Fixes 6544 (#9427)

* Fix call to converters with var/lent args

Fixes #6544

* Fix printing of lent types

* lent is only valid for result types
This commit is contained in:
LemonBoy
2018-10-19 21:04:32 +02:00
committed by Andreas Rumpf
parent d0dd5ea887
commit 16a70c84aa
3 changed files with 20 additions and 1 deletions

View File

@@ -18,3 +18,11 @@ converter toPtr*(some: var TFoo): ptr TFoo = (addr some)
proc zoot(x: ptr TFoo) = discard
var x: Tfoo
zoot(x)
# issue #6544
converter withVar(b: var string): int = ord(b[1])
block:
var x = "101"
var y: int = x # instantiate withVar
doAssert(y == ord('0'))