[Issue 11525] REG(2.065): Error: 'a[] *= a[]' each element is not a scalar, it is a Complex!double

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Nov 27 07:59:40 PST 2013


https://d.puremagic.com/issues/show_bug.cgi?id=11525



--- Comment #4 from Kenji Hara <k.hara.pg at gmail.com> 2013-11-27 07:59:39 PST ---
(In reply to comment #2)
> (In reply to comment #1)
> > I'm not sure this is supposed to work... Structs with overloaded operators
> > generally don't work with array operations.
> 
> I don't see why it shouldn't be allowed (besides the fact that it did work up
> till now). Without this complex numbers are very much 2nd class citizens for
> example.

This change was introduced by fixing bug 11376.

(In reply to comment #3)
> Yes, but unless the 2.064 behavior was intentional, this is an enhancement and
> not a regression.  I remember this being discussed before but I don't know
> where.

If an used array-op is not directly implemented in druntime, compiler will
implicitly generate a function to implement the required array-op by using
for-loop. So, if the array-op operand properly supports arithmetic operations
(+, -, *, /, ...), corresponding array-op should also be accepted.

So, this is really a regression IMO.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list