Post by llotharI can't find any example how reducing visibility by using the export
clause feature during inheritance can result in a catcall.
An example:
class A
feature
proc do end
end
class B
inherit A export {NONE} proc end
end
Somewhere in your code:
a:A
b:B
...
a.proc; -- ok
b.proc; -- forbidden
a := b; -- polymorphic attachment
a.proc -- aaargh!
When a.proc is executed, really B's proc will be called
at runtime - however, this is not allowed according to
the class declaration of B. So we have a CATcall because of
changed access and thus a hole in the type system. At least
it usually won't crash ;-)
Narrowing down access rights in descendants cries for
problems because B is now only a subclass, not a subtype of A.
AFAIR the ECMA standard joins all exports of a feature,
so actually B.proc would be exported to {ANY,NONE}. It's not
intuitive, but at least it is a solution.
CATcalls because of covariant type redefinition is still not
solved in any way -- and IMHO it can't, without sacrificing a
lot of Eiffel's flexibility.
Martin