this is slightly different code from Issue 402 and Issue 784, but it causes the compiler to freeze in DMD 1.046 and 2.032: > dmd -c Conflicts.d Conflicts.d(12): Error: mixin Conflicts.foo.BadImpl!(uint,Mix1) cannot resolve forward reference Conflicts.d(12): Error: mixin Conflicts.foo.BadImpl!(uint,Mix1) cannot resolve forward reference --- Conflicts.d ---- template BadImpl(T, alias thename) { void a_bad_idea(T t) { thename.a_bad_idea(t); } } class foo { mixin BadImpl!(uint,Mix1) Mix1; } int main() { return 0; }
Here's a superficial patch. If an error occurs while determining the arguments, it shouldn't try to determine which template is intended. Patch: template.c, line 4542. -------- // Run semantic on each argument, place results in tiargs[] + int olderrors = global.errors; semanticTiargs(sc); + if (global.errors != olderrors) return; // Quit immediately if error occurs in argument tempdecl = findBestMatch(sc); if (!tempdecl) { inst = this; return; // error recovery }
I guess this counts as an actual forward reference bug, given that Mix1 is kind-of a forward reference.... (This seems to be a variation of CRTP.) (In reply to comment #0) > this is slightly different code from Issue 402 and Issue 784, but > it causes the compiler to freeze in DMD 1.046 and 2.032: Uh, 2.032 doesn't seem to have been released yet.
Fixed dmd 1.049 and 2.034
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル