Okay, turns out that the »collateral regression« the fix for bug 6220 caused in my code ([1]) really is a fundamental problem with how DMD handles template instantiations in the face of error gagging, in this case because is(typeof()) is used (same for __traits(compiles, ...)): --- template A(T) { B!(T).Result result; } template B(U) { static assert(is(U == int)); alias bool Result; } pragma(msg, is(typeof(A!short))); --- The static assert in B!() should just cause is(typeof()) to evaluate to false, but B!short is also added to the module member list, causing compilation to fail because of !is(short == int). I am working on a fix, but need an issue number to reference. [1] https://github.com/D-Programming-Language/dmd/commit/60f4ec88decbcd00e765ab392bf8be8f526ed1ab#commitcomment-535706
Wish I had discovered that earlier, not just from a bugzilla reference in the DMD source after I tracked the problem down: A very similar bug has already been reported, issue 4302. However, the fix proposed there (which got committed in e66a3a5) only hides the issue for static if conditionals, while it can also appear if trySemantic() is attempted outside them, see above. I think the correct solution for the problem is to remove the template instance from the member list of the enclosing scope again if instantiation failed while errors were gagged: https://github.com/D-Programming-Language/dmd/pull/364
(I realize that A!short would never have a type, even if B!short could be instantiated, but this is not important here.)
https://github.com/D-Programming-Language/dmd/commit/3da0a36698b9cc424dbc8f6e7b2786768ae50f84
*** Issue 6385 has been marked as a duplicate of this issue. ***
https://github.com/D-Programming-Language/dmd/commit/3da0a36698b9cc424dbc8f6e7b2786768ae50f84 https://github.com/D-Programming-Language/dmd/commit/5c236d7583f05d10aa55126e16abd00b6e4ff458
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル