Bug 24300 – error message for a jump over `scope(exit)` leaks internal details

Status
NEW
Severity
minor
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2023-12-25T16:10:14Z
Last change time
2024-12-13T19:32:17Z
Keywords
diagnostic
Assigned to
No Owner
Creator
basile-z
See also
https://issues.dlang.org/show_bug.cgi?id=24802
Moved to GitHub: dmd#20373 →

Comments

Comment #0 by b2.temp — 2023-12-25T16:10:14Z
The error output for ```d extern(C) int puts(const char*); int main () { goto L0; scope(exit) puts("meow"); L0: puts("cat says"); return 0; } ``` is > Error: cannot `goto` into `try` block This leaks the fact that the exit scope guard is lowered to a try-finally statement, a detail that does not necessarily interests the user or that can even be confusing A better message would be > Error: cannot `goto` skip over `exit` scope guard
Comment #1 by b2.temp — 2023-12-25T16:12:22Z
Not that much better... I meant > Error: `goto` skips over `exit` scope guard
Comment #2 by robert.schadek — 2024-12-13T19:32:17Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/20373 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB