The following snippet causes a compilation failure / wrong formatting depending on whether a is const/mutable: ---------------------------------------------- struct S { int[2] arr; int[] get() { return arr[]; } alias get this; } const a = S([1, 2]); assert(a == S([3, 4]); ----------------------------------------------- Mutable: "[1, 2] != [3, 4]" instead of "S([1, 2]) != S([3, 4])". Const: "Mutable method `get` is not callable using a `const` object!"
@MoonlightSentinel created dlang/druntime pull request #3029 "Fix Issue 20731 - checkaction=context fails for structs with 'alias <slice> this'" fixing this issue: - Fix Issue 20731 - checkaction=context fails for structs with 'alias <slice> this' Exclude structs wich are implicitly convertible to a slice due to `alias this`". https://github.com/dlang/druntime/pull/3029
dlang/druntime pull request #3029 "Fix Issue 20731 - checkaction=context fails for structs with 'alias <slice> this'" was merged into stable: - d15e8ec1ecd8a5c917f9f22c3e4ae2986694ec7d by MoonlightSentinel: Fix Issue 20731 - checkaction=context fails for structs with 'alias <slice> this' Exclude structs wich are implicitly convertible to a slice due to `alias this`". https://github.com/dlang/druntime/pull/3029