On Sunday, 8 April 2018 at 13:00:02 UTC, bauss wrote:
void handleBar(T : Foo)(T foos)
foreach (child; foos)
child._baz = true; // Not ok.
replace this line with
void a.Foo.handleBar!(Bar).handleBar(Bar foos)
So foos is actually an array of Bars. And there is no access from
a Bar to the private elements of it's baseclass Foo.
What I am wondering about is why does the method template match
in the first place?
(cast(Foo)child)._baz = true; // Ok.
You also may use the ternary conditional operator for that (SCNR).