[Issue 4540] New: Better error message for wrong switch type
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sat Jul 31 04:30:02 PDT 2010
http://d.puremagic.com/issues/show_bug.cgi?id=4540
Summary: Better error message for wrong switch type
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Keywords: diagnostic
Severity: minor
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: bearophile_hugs at eml.cc
--- Comment #0 from bearophile_hugs at eml.cc 2010-07-31 04:29:59 PDT ---
This is a wrong D2 program:
void main() {
float x;
switch (x) {
default:
}
}
dmd 2.047 prints:
test.d(3): Error: 'x' is not of integral type, it is a float
But in D strings too are allowed in switch, so a better error message can be:
test.d(3): Error: 'x' is not of integral type or string, it is a float
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list