More converter fixes (#9737)

* fixes #9735
* fixes #9736
* fixes #3503
This commit is contained in:
cooldome 2018-11-26 08:51:13 +00:00 • committed by Andreas Rumpf
commit c50a04adc5
3 changed files with 82 additions and 12 deletions

View file

@ -26,3 +26,19 @@ block:
var x = "101"
var y: int = x # instantiate withVar
doAssert(y == ord('0'))
######################
# bug #3503
type Foo = object
r: float
converter toFoo(r: float): Foo =
result.r = r
proc `+=`*(x: var Foo, r: float) =
x.r += r
var a: Foo
a.r += 3.0