1285 – Exception typedefs not distinguished by catch

D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 1285 - Exception typedefs not distinguished by catch
Summary: Exception typedefs not distinguished by catch
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86 Linux
: P3 minor
Assignee: Walter Bright
URL:
Keywords: EH
Depends on:
Blocks:
Reported: 2007年06月22日 21:51 UTC by Paul Collier
Modified: 2014年02月14日 20:35 UTC (History)
1 user (show)

See Also:


Attachments
Add an attachment (proposed patch, testcase, etc.)

Note You need to log in before you can comment on or make changes to this issue.
Description Paul Collier 2007年06月22日 21:51:08 UTC
typedef Exception A;
typedef Exception B;
void main() {
 try {
 throw new A("test");
 }
 catch (B) {
 // this shouldn't happen, but does
 }
 catch (A) {
 // this ought to happen?
 }
}
Note, however, that dmd doesn't complain that the first catch masks the second, unlike when I write "catch (Exception) {...} catch (A) {...}." Something's up!
Comment 1 Walter Bright 2007年07月01日 14:08:41 UTC
Fixed DMD 1.018 and DMD 2.002


AltStyle によって変換されたページ (->オリジナル) /