2013/2/23 deadalnix <[email protected]> > On Friday, 22 February 2013 at 15:15:02 UTC, kenji hara wrote: > >> 2013/2/23 deadalnix <[email protected]> >> >> class A { >>> void foo() {} >>> } >>> >>> class B { >>> override void foo() const {} >>> } >>> >>> Add a const foo method to A, and B;foo don't overload the same method >>> anymore. >>> >>> >> B.foo overrides A.foo. It is properly allowed as a particular case in >> contravariant parameter type. >> >> Kenji Hara >> > > I know that. Now if you add a const version of foo in A, B;foo don't > override the same method anymore. >
Yes, then the B's definition should raise "mutable A.foo() is not overridden but hidden in B" (but doesn't because of bug 8366). Kenji Hara
