[Issue 15985] [REG2.068/2.069] Code doesn't link unless compiled with -debug
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun Jan 29 19:29:40 UTC 2023
https://issues.dlang.org/show_bug.cgi?id=15985
--- Comment #6 from Walter Bright <bugzilla at digitalmars.com> ---
(In reply to ag0aep6g from comment #4)
> void f()()
> {
> g!()();
> h!()();
> }
>
> void g()() { f!()(); }
> void h()() { f!()(); }
>
> enum x = is(typeof(f!()()));
> alias my_g = g!();
>
> void main() {}
Here's what I suspect is going on with this. Let's follow the semantic
analsysis:
1. x is the first to get semantically analyzed. The typeof instantiates f!()
2. f!() instantiates g!() and h!()
3. my_g instantiates g!() directly
h!() is only instantiated indirectly, and since that instantiation happens
during a typeof, it never gets marked as needing code to be generated for it.
--
More information about the Digitalmars-d-bugs
mailing list