[Issue 7640] New: CTFE: Confusing error message when looking up missing hash key
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sat Mar 3 18:23:48 PST 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7640
Summary: CTFE: Confusing error message when looking up missing
hash key
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
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> 2012-03-03 18:23:47 PST ---
enum Enums
{
a,
b
}
void main()
{
enum Fields =
[
Enums.a : "a",
];
mixin("auto x = " ~ Fields[Enums.b] ~ ";");
}
Errors:
test.d(16): Error: argument to mixin must be a string, not ("auto x = " ~
[cast(Enums)0:"a"][cast(Enums)1] ~ ";")
test.d(16): Error: argument to mixin must be a string, not ("auto x = " ~
[cast(Enums)0:"a"][cast(Enums)1] ~ ";")
I'd rather the errors be something like:
test.d(16): Error: CTFE: Key 'Enums.b' is not in 'Fields'
test.d(16): Error: argument to mixin must be a string, not ("auto x = " ~
(__error) ~ ";")
We could also get rid of duplicate error messages.
--
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