www.digitalmars.com         C & C++   DMDScript  

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

reply d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11525

           Summary: REG(2.065): Error: 'a[] *= a[]' each element is not a
                    scalar, it is a Complex!double
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: timothee.cour2 gmail.com


--- Comment #0 from Timothee Cour <timothee.cour2 gmail.com> 2013-11-16
01:15:17 PST ---
works in 2.064.2, fails in 2.065
import std.complex;
void main(){
  auto a=[Complex!double.init];
  a[]*=a[];
}

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 16 2013
next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11525


yebblies <yebblies gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |yebblies gmail.com


--- Comment #1 from yebblies <yebblies gmail.com> 2013-11-16 20:27:53 EST ---
I'm not sure this is supposed to work... Structs with overloaded operators
generally don't work with array operations.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 16 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11525



--- Comment #2 from Timothee Cour <timothee.cour2 gmail.com> 2013-11-16
01:32:00 PST ---
(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. -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Nov 16 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11525



--- Comment #3 from yebblies <yebblies gmail.com> 2013-11-16 22:07:08 EST ---
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.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 16 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11525



--- Comment #4 from Kenji Hara <k.hara.pg 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: -------
Nov 27 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11525


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull, rejects-valid


--- Comment #5 from Kenji Hara <k.hara.pg gmail.com> 2013-11-27 08:42:20 PST ---
https://github.com/D-Programming-Language/dmd/pull/2891

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 27 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11525



--- Comment #6 from github-bugzilla puremagic.com 2013-11-30 08:38:17 PST ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/46bee52320310ed25e838e0dc3d99224fd7e6596
fix Issue 11525 - Error: 'a[] *= a[]' each element is not a scalar, it is a
Complex!double

https://github.com/D-Programming-Language/dmd/commit/9a7ebe8f4b84f406a68bb27fe11d1a769767278b
Merge pull request #2891 from 9rnsr/fix11525

[REG2.065a] Issue 11525 - Error: 'a[] *= a[]' each element is not a scalar, it
is a Complex!double

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 30 2013
prev sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11525


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


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