(This is a bug regarding the trunk version of DMD (commit ea65289). The following code works fine in 2.052.) In the latest version of DMD on github, assigning to an array member of a struct in compile-time is rejected. ----------------- struct Foo { string g; } Foo f() { Foo x; x.g = "y"; // Error: x.g = "y" cannot be evaluated at compile time return x; } pragma(msg, f()); ----------------- This causes tuple of string cannot be created in compile-time. The struct literal `Foo("y")` works though.
The bug was introduced in commit d96bbcb3cbf7cd561c47. (https://github.com/D-Programming-Language/dmd/commit/d96bbcb3cbf7cd561c477497c872d616ae5343a1)
D2 fix: https://github.com/D-Programming-Language/dmd/commit/0c9c52c7123e7336ce732e72099dbebd183742e2
D1 fix: https://github.com/D-Programming-Language/dmd/commit/bd196a9020883d94c7b7c4d8a91943d5735f4f3c
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル