mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-21 14:55:24 +00:00
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:
@@ -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'))
|
||||
|
||||
Reference in New Issue
Block a user