[Issue 3282] The overload and override issue of const/immutable member functions

2015-06-09 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=3282

Andrei Alexandrescu and...@erdani.com changed:

   What|Removed |Added

Version|2.031   |D2

--


[Issue 3282] The overload and override issue of const/immutable member functions

2012-06-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3282


Kenji Hara k.hara...@gmail.com changed:

   What|Removed |Added

 Status|REOPENED|RESOLVED
 Resolution||FIXED


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


[Issue 3282] The overload and override issue of const/immutable member functions

2012-03-03 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3282


Kenji Hara k.hara...@gmail.com changed:

   What|Removed |Added

   Keywords||pull


--- Comment #11 from Kenji Hara k.hara...@gmail.com 2012-03-03 07:18:10 PST 
---
https://github.com/D-Programming-Language/dmd/pull/779

I also think this never breaks type systems, and additional overloads is
useful.
e.g. http://d.puremagic.com/issues/show_bug.cgi?id=7534#c6

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


[Issue 3282] The overload and override issue of const/immutable member functions

2012-01-24 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3282


timon.g...@gmx.ch changed:

   What|Removed |Added

 Status|RESOLVED|REOPENED
 Resolution|INVALID |


--- Comment #10 from timon.g...@gmx.ch 2012-01-24 07:18:45 PST ---
The signature of the overriding function is identical to the overridden one in
all cases discussed here.

class A{
void f(){} // note: return type void
}
class B: A{
override void f(){} // overrides base f 
void f()immutable{} // new overload 
void f()shared{}   // new overload  
}

It is impossible to break the type system (even if the return types would be
different): the new overloads are not even reachable through a base class
reference. The bug is that the compiler does not take into account the storage
class of the hidden this pointer while deciding what overrides what.

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


[Issue 3282] The overload and override issue of const/immutable member functions

2012-01-23 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3282


Walter Bright bugzi...@digitalmars.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||bugzi...@digitalmars.com
 Resolution||FIXED


--- Comment #4 from Walter Bright bugzi...@digitalmars.com 2012-01-23 
01:28:50 PST ---
I believe the errors are correct.

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


[Issue 3282] The overload and override issue of const/immutable member functions

2012-01-23 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3282


timon.g...@gmx.ch changed:

   What|Removed |Added

 Status|RESOLVED|REOPENED
 CC||timon.g...@gmx.ch
 Resolution|WORKSFORME  |


--- Comment #5 from timon.g...@gmx.ch 2012-01-23 13:41:57 PST ---
I think it is a bug. The derived class introduces two additional overloads. The
compiler claims that all three overloads override the same function.

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


[Issue 3282] The overload and override issue of const/immutable member functions

2012-01-23 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3282


Walter Bright bugzi...@digitalmars.com changed:

   What|Removed |Added

 Status|REOPENED|RESOLVED
 Resolution||INVALID


--- Comment #6 from Walter Bright bugzi...@digitalmars.com 2012-01-23 
15:47:44 PST ---
(In reply to comment #5)
 I think it is a bug. The derived class introduces two additional overloads. 
 The
 compiler claims that all three overloads override the same function.

The error messages are deliberate.

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


[Issue 3282] The overload and override issue of const/immutable member functions

2012-01-23 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3282


timon.g...@gmx.ch changed:

   What|Removed |Added

 Status|RESOLVED|REOPENED
 Resolution|INVALID |


--- Comment #7 from timon.g...@gmx.ch 2012-01-23 16:37:46 PST ---
If so, why is this code accepted?

class A{
void f(int){}
}
class B: A{
override void f(int){}
void f(immutable int){}
void f(shared int){}
}

What is the point of deliberately treating the hidden this pointer special
regarding overloading?

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


[Issue 3282] The overload and override issue of const/immutable member functions

2012-01-23 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3282



--- Comment #8 from timon.g...@gmx.ch 2012-01-23 16:39:10 PST ---
Furthermore, this works, of course:

class B{
void f(int){}
void f(int)immutable{}
void f(int)shared{}
}

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


[Issue 3282] The overload and override issue of const/immutable member functions

2012-01-23 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3282


Walter Bright bugzi...@digitalmars.com changed:

   What|Removed |Added

 Status|REOPENED|RESOLVED
 Resolution||INVALID


--- Comment #9 from Walter Bright bugzi...@digitalmars.com 2012-01-23 
19:36:45 PST ---
The return types are the issue. You cannot, for example, override a function
that returns a mutable array with one that returns an immutable one. It would
be a giant hole in the type system.

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


[Issue 3282] The overload and override issue of const/immutable member functions

2010-01-22 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3282


Rainer Schuetze r.sagita...@gmx.de changed:

   What|Removed |Added

 CC||r.sagita...@gmx.de


--- Comment #2 from Rainer Schuetze r.sagita...@gmx.de 2010-01-22 00:37:37 
PST ---
This kind of works now with changeset 344. But both f() and f() const
overload f() in the base class, and the last one wins. I think dmd should
either issue an error or add another entry to the vtbl for the non-exact but
covariant match.

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


[Issue 3282] The overload and override issue of const/immutable member functions

2009-10-19 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3282



--- Comment #1 from Haruki Shigemori rayerd@gmail.com 2009-10-19 03:22:09 
PDT ---
This problem occurs when const is shared.

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