This code used to work up to version 2.031 without problems, since 2.032 it manages to crash dmd. [CODE] typedef byte[] Foo; Foo bar; foreach(value; bar){} [/CODE]
There's a missing toBaseType() in the Foreach code which was introduced in D2.032. PATCH: statement.c, line 1525, in ForeachStatement::semantic(): ------ Identifier *id = Lexer::uniqueId("__aggr"); ExpInitializer *ie = new ExpInitializer(loc, new SliceExp(loc, aggr, NULL, NULL)); - VarDeclaration *tmp = new VarDeclaration(loc, aggr->type->nextOf()->arrayOf(), id, ie); + VarDeclaration *tmp = new VarDeclaration(loc, aggr->type->toBasetype()->nextOf()->arrayOf(), id, ie); Expression *tmp_length = new DotIdExp(loc, new VarExp(loc, tmp), Id::length);
typedef is gone.
huh ? it is gone ? in dmd 2.032 - 2.039 it is certainly not, otherwise the compiler would complain using it (puting this crash aside). since when is typedef gone and why ?
whatever is meant by "typedef is gone" the compiler should not crash under any circumstance. feel free to change the keywords to ice-on-invalid if that is the actual case.
Changeset 350
fixed dmd 1.056 and 2.040
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル