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.
Comment #3 by yebblies — 2011-06-09T09:10:40Z
Renaming as the missing line number is a dupe of bug 4661. A possible solution to the _error_/__error part of this bug is to propagate TypeError when composing types. Possible fix: https://github.com/yebblies/dmd/commit/3e0e2cd91cfe6e0154dbd2ad38419811f172dd01
Comment #4 by bugzilla — 2011-07-01T19:09:59Z