Var parameters are prioritized over non var parameters when passed mutable values. This may be a bug due to using the the generic object typeclass. This code works. type Foo = object i: int proc foo(x: Foo): int = x.i*2 proc foo(x: var Foo) = x.i*=2 let x = Foo(i: 3) var y = Foo(i: 4) echo foo(x) foo(y) Run
- Overloaded proc dispatch won't work with object type moigagoo
- Re: Overloaded proc dispatch won't work with object type Varriount
- Re: Overloaded proc dispatch won't work with object typ... solo989