Print function bodies instead of __lambda in error messages

This commit is contained in:
Dennis Korpel 2025-02-13 12:42:18 +01:00 committed by The Dlang Bot
parent 0bb48e277c
commit efd10b140c
53 changed files with 289 additions and 204 deletions

View file

@ -18,6 +18,23 @@ 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`
)
Function literals are now referred to by their (truncated) function body, instead of the internal `__lambda` name.
---
/*
BEFORE:
../test/test_.d(3): Error: function literal `__lambda1()` is not callable using argument types `(int)`
(() => 42)(1);
^
AFTER:
../test/test_.d(3): Error: function literal `() => 42` is not callable using argument types `(int)`
(() => 42)(1);
^
*/
---
Match levels are now mentioned on ambiguous overloads: [#20637](https://github.com/dlang/dmd/pull/20637)
Before: