There are cases where const values can implicitly convert to mutable, such as structs without mutable indirections or basic types. However, when this fails, the compiler does not tell the user why that is. For example...
```
void main() {
const Foo a;
Foo b = a; // okay, no problems here
const Bar c;
//Bar d = c; // Error: cannot implicitly convert expression `c` of type `const(Bar)` to `Bar`
}
struct Foo {
int value;
}
struct Bar {
void* ptr;
}
```
It would be very helpful if the compiler could offer hints as to why the implicit conversion failed, similar to attribute inferrence failures. This can be difficult to track down manually as structs grow in complexity.
Comment #1 by robert.schadek — 2024-12-13T19:30:22Z