I am struggling to understand the interplay of multiple inheritance with replication and polymorphism. Please consider the following classes forming a classical diamond pattern.
deferred class A
feature
a deferred end
end
deferred class B
inherit A
rename a as b end
end
deferred class C
inherit A
rename a as c end
end
class D
inherit
B
C
select c end
feature
b do print("b") end
c do print("c") end
end
If I attach an instance of D to an object ob_as_c
of type C, then ob_as_c.c
prints "c" as expected. However, if attach the instance to an object ob_as_b
of type B, then ob_as_b.b
will print also print "c".
Is this intended behaviour? Obviously, I would like ob_as_b.b
to print "b".