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

Reply via email to