Re: Error in proc with var and ptr parameters

2019-10-22 Thread mratsim
It's a compiler bug. Probably the var is not corretly seen when it's not the top modifier. For example I think `var (int | uint)` would work but `var int | int` would not. I suggest you use overloading instead.

Error in proc with var and ptr parameters

2019-10-12 Thread Citrusn
type VALUE = object d: uint32 #proc init(v: var VALUE) = # working code # v.d = 3 proc init(v: var VALUE | ptr VALUE) = when v is ptr VALUE: v[].d = 1 else: v.d = 2 # compile error var v: VALUE v.init() echo repr v