Bug 19105 – Bogus recursive template expansion via getSymbolsByUDA

Status
REOPENED
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2018-07-22T06:51:46Z
Last change time
2024-12-13T18:59:42Z
Keywords
pull, rejects-valid
Assigned to
No Owner
Creator
Abscissa
Blocks
340
Moved to GitHub: dmd#19461 →

Comments

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
Comment #7 by dlang-bot — 2019-12-07T15:26:45Z
@PetarKirov created dlang/phobos pull request #7309 "Merge stable" fixing this issue: - Revert "Fix Issue 19105 - Bogus recursive template expansion via getSymbolsByUDA" This reverts commit 86733d5a4a5379219f04524bead35eff33c6a1a7. - Merge pull request #7158 from Biotronic/revert-7100 Revert "Fix Issue 19105 - Bogus recursive template expansion via getS… https://github.com/dlang/phobos/pull/7309
Comment #8 by robert.schadek — 2024-12-13T18:59:42Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19461 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB