If I try to make a static assert message span multiple lines, it doesn't work. This is because it tries to display it as a string in code, and in the process turns certain characters into their escape sequences. ---------- static assert (false, "An error message \tthat spans multiple lines, and also contains such characters as a tab, \\ and \"."); ---------- static_assert_linebreaks.d(1): static assert "An error message\x0a\x09that spans multiple lines, and also contains such characters as a tab,\x0a\\' and \"." ---------- Since the purpose of this is to display a message while running the compiler, it should just display the string, rather than a code representation of it. That is, the compiler output should look something like this: static_assert_linebreaks.d(1): static assert is false: An error message that spans multiple lines, and also contains such characters as a tab, \ and ".
Oh, u need to define valid escape sequence usable in that static assert specifically consider: static assert(false, "%s"); what supposed to be happen? surely not segfault or arbitrary strings. so only \ leading ones need to be taken care of specially. while this complicates the compiler. I doubt if walter would love to implement it in the near future :)
There is no escape sequence in the string "%s". There are just two characters - '%' and 's'.
Fixed in 1.017.
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル