www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 9858] New: const alias this fails when opAssign is present

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

           Summary: const alias this fails when opAssign is present
           Product: D
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: nilsbossung googlemail.com


--- Comment #0 from Nils <nilsbossung googlemail.com> 2013-04-02 06:42:10 PDT
---
Works with 2.062.

---
cat > test.d <<code
struct S()
{
     property int get() const
    {
        return 42;
    }
    alias get this;
    void opAssign(int) {}
}
void main()
{
    const S!() s;
    int i = s;
}
code
dmd -c -o- test.d
---
test.d(13): Error: cannot implicitly convert expression (s) of type const(S!())
to int
---

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 02 2013
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9858


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull, rejects-valid
            Version|unspecified                 |D2


--- Comment #1 from Kenji Hara <k.hara.pg gmail.com> 2013-04-02 19:12:49 PDT ---
https://github.com/D-Programming-Language/dmd/pull/1828

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 02 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9858



--- Comment #2 from github-bugzilla puremagic.com 2013-04-04 01:24:48 PDT ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/c6ebfc21c8fd050b13dfd8cb2da8803797d261bc
fix Issue 9858 - const alias this fails when opAssign is present

Type::makeXXX had unintentionally taken over Type(Struct|Class)::att field.

https://github.com/D-Programming-Language/dmd/commit/afd7c3d0555d7407bc55a2fb3e3dbf864413d23e
Merge pull request #1828 from 9rnsr/fix9858

[REG2.063a] Issue 9858 - const alias this fails when opAssign is present

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 04 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9858


Kenji Hara <k.hara.pg gmail.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: -------
Apr 04 2013