www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 7276] New: ambugious method call with shared / const / immutable

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

           Summary: ambugious method call with shared / const / immutable
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: code benjamin-thaut.de



PST ---
Repro case:

class Repro {
  int data() { return 0; }
  int data() const { return 1; }
  int data() shared { return 2; }
  int data() immutable { return 3; }

  int opSlice() { return data(); }
  int opSlice() const { return data(); }
  int opSlice() shared { return data(); }
  int opSlice() immutable { return data(); }
}

The calls inside opSlice are ambugious accodring to the compiler.
If you replace the call with data() with this.data() everything works fine.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 11 2012
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7276


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

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



This is same as bug 3733.
And I've posted a patch to fix them.

*** This issue has been marked as a duplicate of issue 3733 ***

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