[Issue 9858] New: const alias this fails when opAssign is present

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Apr 2 06:42:10 PDT 2013


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 at puremagic.com
        ReportedBy: nilsbossung at googlemail.com


--- Comment #0 from Nils <nilsbossung at 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: -------


More information about the Digitalmars-d-bugs mailing list