D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 7276 - ambugious method call with shared / const / immutable
Summary: ambugious method call with shared / const / immutable
Status: RESOLVED DUPLICATE of issue 3733
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: Other Windows
: P2 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-11 22:50 UTC by Benjamin Thaut
Modified: 2012-01-11 23:07 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Benjamin Thaut 2012-01-11 22:50:47 UTC
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.
Comment 1 Kenji Hara 2012-01-11 23:07:19 UTC
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 ***