Bug 6059 – Incompatible types in array literal shows __error and error
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2011-05-26T13:22:00Z
Last change time
2011-07-01T19:09:59Z
Keywords
diagnostic, patch
Assigned to
nobody
Creator
bearophile_hugs
Comments
Comment #0 by bearophile_hugs — 2011-05-26T13:22:12Z
D2 code:
enum Foo : char { A = 'A' }
void main() {
Foo[][] bar = [cast(Foo[])"AA", "AA"];
}
DMD 2.053 gives an error message without line number, plus shows __error and _error_ labels:
Error: incompatible types for (("AA") ? ("AA")): 'Foo[]' and 'string'
test.d(3): Error: cannot implicitly convert expression ([(__error),(__error)]) of type _error_[] to Foo[][]
(Normal level of priority because one of the two error messages shows a line number.)
See also bug 6057
Comment #1 by kennytm — 2011-05-26T13:34:33Z
The missing line number in the 1st message is due to bug 5518 (perhaps you want to increase the severity of that bug.)
Comment #2 by bearophile_hugs — 2011-05-26T13:50:21Z
(In reply to comment #1)
> The missing line number in the 1st message is due to bug 5518 (perhaps you want
> to increase the severity of that bug.)
Done. Thank you.