But because I'm still in the 1st outer ctor make(Str, |This|), I'd expect all checks to be held off until I leave that ctor.
brianTue 21 May 2013
The problem every constructor has to stand on its own. So one make completes it will check that all non-nullable fields were set before exiting. I'm sure we could try and do something crazy like know make was being called in context of another constructor, but that would start to get pretty crazy complicated.
SlimerDudeTue 21 May 2013
Yeah, nesting calls can get pretty complicated. There's a lot (well, shed load!) of nesting inside afIoc. To simplify matters there I pass around a Ctx object which holds various stacks of contextual info. I push contextual info onto the stacks when I go deeper, and pop them on my return.
If you ever re-visit the ctor code, you could maybe think about doing similar there.
SlimerDude Tue 21 May 2013
Me again!
When I chain my ctor like this:
I get a
FieldNotSetErr
when leaving the inner ctor:But because I'm still in the 1st outer ctor
make(Str, |This|)
, I'd expect all checks to be held off until I leave that ctor.brian Tue 21 May 2013
The problem every constructor has to stand on its own. So one
make
completes it will check that all non-nullable fields were set before exiting. I'm sure we could try and do something crazy like know make was being called in context of another constructor, but that would start to get pretty crazy complicated.SlimerDude Tue 21 May 2013
Yeah, nesting calls can get pretty complicated. There's a lot (well, shed load!) of nesting inside afIoc. To simplify matters there I pass around a
Ctx
object which holds various stacks of contextual info. I push contextual info onto the stacks when I go deeper, and pop them on my return.If you ever re-visit the ctor code, you could maybe think about doing similar there.