[Issue 15318] Templates not emitted for two "partial cycles"

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Tue Nov 17 16:01:02 PST 2015


https://issues.dlang.org/show_bug.cgi?id=15318

--- Comment #5 from David Nadlinger <code at klickverbot.at> ---
I very much prefer (In reply to Walter Bright from comment #3)
> It can also be resolved by noting that C is not imported (directly or
> indirectly) by B, and so C's instantiation will not count as an imported
> instantiation when instantianting templates in B.

Yep, this is indeed an option here. We'd still end up emitting the template
twice in this example, though, which is what I alluded to regarding not being
able to elide the instance.

(In reply to Kenji Hara from comment #4)
> I don't think that the issue case is a bug in the current instantiation
> strategy.

I can't really see how you can come to this conclusion. If it's not a
regression, then where is the documentation that states that DMD is not to be
invoked in this fashion?

Like Martin and Andrei, I'd suggest taking a step back and thinking about what
the template instantiation strategy is really meant to achieve first. I don't
think piling up more and more special cases is going to be helpful, especially
because it just pushes this complexity to the user.

--


More information about the Digitalmars-d-bugs mailing list