[Issue 24802] Wrong error message

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Oct 9 15:34:27 UTC 2024


https://issues.dlang.org/show_bug.cgi?id=24802

Dennis <dkorpel at live.nl> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dkorpel at live.nl
           See Also|                            |https://issues.dlang.org/sh
                   |                            |ow_bug.cgi?id=24300

--- Comment #1 from Dennis <dkorpel at live.nl> ---
The compiler rewrites things that happen on scope exit (such as destructors)
into try-finally blocks. The same happens with scope guards:
```
void main()
{
    goto x;    
    scope(exit) {}
    x:
}
```

See also issue 24300. The solution is probably to add a field to the lowered
AST node keeping track of where a try-finally block came from.

--


More information about the Digitalmars-d-bugs mailing list