[Issue 7276] New: ambugious method call with shared / const / immutable

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jan 11 22:50:48 PST 2012


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 at puremagic.com
        ReportedBy: code at benjamin-thaut.de


--- Comment #0 from Benjamin Thaut <code at benjamin-thaut.de> 2012-01-11 22:50:47 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: -------


More information about the Digitalmars-d-bugs mailing list