Comment #0 by bus_dlangzilla — 2018-07-22T06:51:46Z
---------------------------------------------
module junk;
import std.traits;
struct A(Args...) {}
struct B {}
alias C = A!( getSymbolsByUDA!(junk, B) );
---------------------------------------------
$ dmd junk.d
junk.d(7): Error: template instance `A!(getSymbolsByUDA!(junk, B))` recursive template expansion
junk.d(7): Error: alias `junk.C` recursive alias declaration
Comment #1 by dlang-bot — 2019-07-04T13:10:11Z
@RazvanN7 created dlang/phobos pull request #7100 "Fix Issue 19105 - Bogus recursive template expansion via getSymbolsByUDA" fixing this issue:
- Fix Issue 19105 - Bogus recursive template expansion via getSymbolsByUDA
https://github.com/dlang/phobos/pull/7100
Comment #2 by dlang-bot — 2019-07-10T09:57:44Z
dlang/phobos pull request #7100 "Fix Issue 19105 - Bogus recursive template expansion via getSymbolsByUDA" was merged into master:
- 86733d5a4a5379219f04524bead35eff33c6a1a7 by RazvanN7:
Fix Issue 19105 - Bogus recursive template expansion via getSymbolsByUDA
https://github.com/dlang/phobos/pull/7100
Comment #3 by simen.kjaras — 2019-07-18T13:21:11Z
The "fix" in PR 7100 does nothing to fix the actual issue here - it only prohibits valid use cases, and should very clearly be reverted. See issue 20054.
This issue is a DMD issue, and no amount of Phobos fiddling is gonna fix it. Here's a reduced example:
template test(alias T) {
alias i = T.C;
alias test = int;
}
struct A(Args...) {}
struct S1 {
// No error
alias dummy = test!S1;
alias C = A!(test!S1);
}
struct S2 {
// Recursive template expansion
alias C = A!(test!S2);
}
As we can see, we're not using the result of T.C, and the simple use of a dummy alias prevents the recursive expansion. Clearly, something is wrong in the compiler for this behavior to happen.
Comment #4 by dlang-bot — 2019-08-28T12:02:39Z
@Biotronic created dlang/phobos pull request #7158 "Revert "Fix Issue 19105 - Bogus recursive template expansion via getS…" fixing this issue:
- Revert "Fix Issue 19105 - Bogus recursive template expansion via getSymbolsByUDA"
This reverts commit 86733d5a4a5379219f04524bead35eff33c6a1a7.
https://github.com/dlang/phobos/pull/7158
Comment #5 by dlang-bot — 2019-12-01T23:40:16Z
dlang/phobos pull request #7158 "Revert "Fix Issue 19105 - Bogus recursive template expansion via getS…" was merged into stable:
- f286ee1b2fc65107bd164c0a5b90b1d506f576ab by Simen Kjærås:
Revert "Fix Issue 19105 - Bogus recursive template expansion via getSymbolsByUDA"
This reverts commit 86733d5a4a5379219f04524bead35eff33c6a1a7.
https://github.com/dlang/phobos/pull/7158
Comment #6 by petar.p.kirov — 2019-12-02T11:44:42Z