Bug 6540 – Default struct constructor problem

Status
RESOLVED
Resolution
WORKSFORME
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2011-08-20T15:27:00Z
Last change time
2014-04-29T15:37:20Z
Keywords
rejects-valid
Assigned to
nobody
Creator
bearophile_hugs

Comments

Comment #0 by bearophile_hugs — 2011-08-20T15:27:16Z
I don't understand what's happening here, but I think there is something wrong: struct V3 { double[3] v; void foo() { auto v2 = v[] / 2; V3 r = V3(v2); // line 5 } } void main() {} DMD 2.055beta gives: test.d(5): Error: cannot implicitly convert expression (v2) of type double[] to double
Comment #1 by andrej.mitrovich — 2013-02-09T05:55:38Z
The error is now: Error: cannot implicitly convert expression (v2) of type double[] to double[3u] But this seems normal to me.
Comment #2 by andrej.mitrovich — 2013-02-09T05:57:00Z
(In reply to comment #1) > The error is now: > > Error: cannot implicitly convert expression (v2) of type double[] to double[3u] > > But this seems normal to me. Edit: This is in git-head, forgot to mention.
Comment #3 by andrej.mitrovich — 2014-04-29T15:37:20Z
The errors are now: test.d(7): Error: invalid array operation v2 = this.v[] / 2.00000 (did you forget a [] ?) test.d(8): Error: cannot implicitly convert expression (v2) of type double[] to double[3] I'm closing this unless you find something else that's still wrong here. Thanks.