[Issue 9848] New: Better diagnostic when type declaration was not expected
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun Mar 31 14:29:33 PDT 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9848
Summary: Better diagnostic when type declaration was not
expected
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Keywords: diagnostic
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: andrej.mitrovich at gmail.com
--- Comment #0 from Andrej Mitrovic <andrej.mitrovich at gmail.com> 2013-03-31 14:29:33 PDT ---
void main()
{
alias Type = int[string];
// cannot use '==' with types
static assert(is(int[string]) == Type);
// Error: found '[' when expecting '.' following int
static assert(is(int[string]) == int[string]);
}
The first error message is informative, but the second one is a syntax error.
The compiler should emit the first message for both cases.
--
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