D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 6889 - "finally" mentioned in a compilation error, instead of "scope(exit)" or "scope(success)"
Summary: "finally" mentioned in a compilation error, instead of "scope(exit)" or "scop...
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 minor
Assignee: No Owner
URL:
Keywords: diagnostic, pull
Depends on:
Blocks:
 
Reported: 2011-11-03 14:34 UTC by Ali Cehreli
Modified: 2014-05-24 20:49 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Ali Cehreli 2011-11-03 14:34:53 UTC
The error message mentions "finally", instead of "scope(exit)":

deneme.d(53539): Error: cannot put catch statement inside finally block

The program to reproduce with dmd 2.056:

void main()
{
    scope(exit) try {} catch {}
}

Note that it is the same with scope(success).
Comment 1 Andrej Mitrovic 2014-04-29 15:39:11 UTC
Yeah, this is caused by an internal rewrite of scope => try/catch/finally block.
Comment 3 github-bugzilla 2014-05-24 20:48:56 UTC
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/bb9fd7e2ad2c0fbc5ddd132129819fdcd2cc6bf0
fix Issue 6889 - "finally" mentioned in a compilation error, instead of "scope(exit)" or "scope(success)"

https://github.com/D-Programming-Language/dmd/commit/75950518c1a448c85aa7e9db2033b09f4c377380
Merge pull request #3564 from 9rnsr/fix_onscope

Issue  6889 & 2456 - Fix diagnostic messages for OnScomeStatement