How about this example?
type S = object
a:int
proc default(t:typedesc[S]):S = S(a:42)
var s:S
echo s # (a: 0) not (a: 42)
Run
- constructor which will be called immediately after var call... chaemon
- constructor which will be called immediately after var... juancarlospaco
- constructor which will be called immediately after... chaemon
