diff --git a/changelog/dmd.error-messages.dd b/changelog/dmd.error-messages.dd new file mode 100644 index 0000000000..dec114bac1 --- /dev/null +++ b/changelog/dmd.error-messages.dd @@ -0,0 +1,45 @@ +Many error messages have changed + +Some changes have been made without being associated to a reported issue: + +Error messages for `@safe` violations now consistently mention they are related to `@safe` functions (or default functions with `-preview=safer`). +In general, function attributes that failed to infer have a more compact error message: + +--- +/* +BEFORE: +app.d(8): Error: function `attributediagnostic_nothrow.gc1` is not `nothrow` +app.d(2): which wasn't inferred `nothrow` because of: +app.d(2): `object.Exception` is thrown but not caught + +AFTER: +app.d(8): Error: function `attributediagnostic_nothrow.gc1` is not `nothrow` +app.d(2): and `object.Exception` being thrown but not caught makes it fail to infer `nothrow` +*/ +--- + +Match levels are now mentioned on ambiguous overloads: [#20637](https://github.com/dlang/dmd/pull/20637) + +--- +/* +BEFORE: +Error: `app.bar` called with argument types `(string)` matches both: + +AFTER: +Error: `app.bar` called with argument types `(string)` matches multiple overloads after implicit conversions: +*/ +--- + +When there's no operator overload found for a type, a new supplemental message points to the declaration. + +--- +/* +app.d(8): Error: no `[]` operator overload for type `U` +app.d(6): `app.U` declared here +*/ +--- + +Furthermore: + +- D1 operator overloading functions (`opAdd`, `opDot`) are completely removed and no longer mentioned in error messages specifically. +- Class allocators (`auto new() {}`) are not only a semantic error, but no longer being parsed