Thread overview
[Issue 7817] New: opAssign to in declaration broken in dmd 1.074 beta1
Apr 03, 2012
Jakob Bornecrantz
Apr 03, 2012
Don
Apr 05, 2012
Walter Bright
Apr 05, 2012
Walter Bright
April 03, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7817

           Summary: opAssign to in declaration broken in dmd 1.074 beta1
           Product: D
           Version: future
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nobody@puremagic.com
        ReportedBy: wallbraker@gmail.com


--- Comment #0 from Jakob Bornecrantz <wallbraker@gmail.com> 2012-04-03 11:41:54 PDT ---
The following code works in dmd.1.073 but is broken in dmd.1.074.

struct Foo {}

struct Bar {
    void opAssign(Foo f) {}
}

void test() {
    Foo f;
    Bar bar = f; // Broken in dmd 1.074-beta

    Bar baz;
    baz = f; // Works as expected.
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
April 03, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7817


Don <clugdbug@yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |clugdbug@yahoo.com.au


--- Comment #1 from Don <clugdbug@yahoo.com.au> 2012-04-03 12:08:11 PDT ---
(In reply to comment #0)
> The following code works in dmd.1.073 but is broken in dmd.1.074.
> 
> struct Foo {}
> 
> struct Bar {
>     void opAssign(Foo f) {}
> }
> 
> void test() {
>     Foo f;
>     Bar bar = f; // Broken in dmd 1.074-bet

That isn't an assignment - it's an initialization.
I wonder why that worked before.

> 
>     Bar baz;
>     baz = f; // Works as expected.
> }

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
April 05, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7817


Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla@digitalmars.com


--- Comment #2 from Walter Bright <bugzilla@digitalmars.com> 2012-04-05 15:25:27 PDT ---
It is a bug that this ever worked. Assignment is not initialization. However, I will revert to the original behavior to avoid breaking existing code.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
April 05, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7817



--- Comment #3 from github-bugzilla@puremagic.com 2012-04-05 15:45:13 PDT ---
Commit pushed to dmd-1.x at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/96f497a2056cf7d511f4d9f29233ff256eaed1f5 fix Issue 7817 - opAssign to in declaration broken in dmd 1.074 beta1

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
April 05, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7817


Walter Bright <bugzilla@digitalmars.com> changed:

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


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