Test case: ------------------ struct S7426 { static struct Inner { int x; alias typeof(Inner.tupleof) T; } } ------------------ Compile with 'dmd -c test7426.d', expecting to pass silently, but fails with: test7426.d(4): Error: struct test7426.S7426.Inner no size yet for forward reference The regression is introduced in commit f2635c912999f819f6f99f46373a768df7f5abfa when fixing bug 7190.
Pull #696. https://github.com/D-Programming-Language/dmd/pull/696
Probably related test case: struct S { static if(hasIndirections!(typeof(this))) {} } template hasIndirections(T) { enum hasIndirections = hasIndirectionsImpl!(T.tupleof); } template hasIndirectionsImpl(T...) { static if (!T.length) { enum hasIndirectionsImpl = false; } else { enum hasIndirectionsImpl = true; } }
(In reply to comment #2) > Probably related test case: > > struct S { > static if(hasIndirections!(typeof(this))) {} > } > > template hasIndirections(T) > { > enum hasIndirections = hasIndirectionsImpl!(T.tupleof); > } > > template hasIndirectionsImpl(T...) > { > static if (!T.length) > { > enum hasIndirectionsImpl = false; > } > else > { > enum hasIndirectionsImpl = true; > } > } Pull #696 removed the 'no size yet for forward reference' in this test case, but DMD will complain 'template instance test.hasIndirectionsImpl!(tuple()) error instantiating' anyway.
Commit pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/7cd2d8b81cd52002665cb61c04109dc6c6d97b7a Issue 7426
This isn't a regression, it never really did work right. But the partial fix at least makes it work correctly for the original bug report. It may not be completely fixable.
Still broken with my test case. Where do we draw the line between regressions and non-regressions? 2.058 has a lot of borderline cases where internal changes in the compiler make pre-existing bugs affect code they didn't used to affect.
(In reply to comment #6) > Still broken with my test case. Where do we draw the line between regressions > and non-regressions? 2.058 has a lot of borderline cases where internal > changes in the compiler make pre-existing bugs affect code they didn't used to > affect. From discussion on the Phobos newsgroup, my test case shouldn't work because X.tupleof shouldn't be defined, if X is not fully defined yet. I'll close this bug report as fixed but start a new one requesting a decent error message so it's clearer that this is why it doesn't work.