opened
quickfur
username_0
Code:
````
import std.experimental.typecons;
void main()
{
    Final!int s;
    s += 5;
}
````

Compiler output (before):
````
test.d(5): Error: function std.experimental.typecons.Final!int.Final.opOpAssign!("+", int).opOpAssign is not callable because it is annotated with @disable
````

Compiler output (after):
````
/usr/src/d/phobos/std/experimental/typecons.d(867): Error: static assert  "Final!int cannot be reassigned."
test.d(5):        instantiated from here: opOpAssign!("+", int)
````

The current error message (before) is rather unhelpful from the user's POV, and exposes too much implementation detail ("I just used `Final!int` to declare a variable, what does `@disable` have to do with it?").  The new error message is more informative and explains why the operation is not allowed.
Nicer error messages for std.typecons.experimental.Final
issue
created
quickfur
username_0
@JackStouffer Done.
comment