D 2.003 crashes as well. struct S { int x; } S foo(alias s)() { const S ret = bar(s); return ret; } S bar(S s) { return s; } S baz(int x)() { const S s = {x}; return foo!(s)(); } const r = baz!(1)();
I'll fix the crashing problem, but the resulting code still won't work. That's because the template arguments are evaluated before trying to match them up with a template. That means the const declaration of s is replaced with a struct literal S(1). Struct literals don't match aliases.
A regrettable limitation and somewhat inconsistent with cases like passing uninitialized constant to alias parameter (issue 1456)
Fixed dmd 1.021 and 2.004
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル