mirror of
https://github.com/dlang/dmd.git
synced 2025-04-25 20:50:41 +03:00
Add changelog entry for error message changes (#20753)
Co-authored-by: Dennis Korpel <dennis@sarc.nl>
This commit is contained in:
parent
ff2543f768
commit
12c1363f86
1 changed files with 45 additions and 0 deletions
45
changelog/dmd.error-messages.dd
Normal file
45
changelog/dmd.error-messages.dd
Normal file
|
@ -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
|
Loading…
Add table
Add a link
Reference in a new issue