An ancient bug: same ICE on D1.020 as on D2.036 TEST CASE: struct Ashes { int ashes = cast(int)0; } void funky (Ashes s = Ashes()) {} void funk() { funky(); } PATCH: This patch also fixes the closely related bug 3422. (The semantic is for this bug. The implicit cast is for bug 3422. The assert is just a precaution). expression.c line 3271. { e = v->type->defaultInit(); e->loc = loc; } offset = v->offset + v->type->size(); } + assert(v->type); + e= e->semantic(sc); + if (e->type !=v->type) e = e->implicitCastTo(sc, v->type); elements->push(e); }
The fix for this is somewhat more complicated than the patch. The problem is the scope of the field initializer is the scope of where the field appears, not where the field is used. I'll see if I can fix it.
Fixed in SVN repository: http://www.dsource.org/projects/dmd/changeset/230
Fixed dmd 1.051 and 2.036
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル