Bug 6889 – "finally" mentioned in a compilation error, instead of "scope(exit)" or "scope(success)"
Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2011-11-03T14:34:00Z
Last change time
2014-05-24T20:49:00Z
Keywords
diagnostic, pull
Assigned to
nobody
Creator
acehreli
Comments
Comment #0 by acehreli — 2011-11-03T14:34:53Z
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 by andrej.mitrovich — 2014-04-29T15:39:11Z
Yeah, this is caused by an internal rewrite of scope => try/catch/finally block.