May be related to 1204 struct Bar { int x; } int foo() { // Fails with 'Error: cannot cast int to Bar' if explicit initialization is omitted: Bar b = Bar.init; b.x = 1; b = bar(b); // Error: cannot evaluate foo() at compile time return b.x; } Bar bar(Bar b) { return b; } void main(char[][] args) { static x = foo(); }
More test cases: struct Bar { int x; } int foo() { Bar b = Bar.init; b.x = 100; for (size_t i = 0; i < b.x; i++) // b.x is the stumbling block here { } b.x++; // fails while b.x = b.x + 1 works return b.x; } void main(char[][] args) { static x = foo(); }
Fixed DMD 1.019 and 2.003
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル