การสืบทอดซ้ำจาก 2 คลาสที่มีพาเรนต์เดียวกัน ฉันตกอยู่ในกรณีคลาสสิกของการสืบทอดแอททริบิวต์เดียวกัน 2 ครั้ง ฉันต้องการรวมแอตทริบิวต์ 2 รายการเป็นหนึ่งเดียวและพยายามทำโดยไม่กำหนด แต่ทำให้ฉันเกิดข้อผิดพลาดในการคอมไพล์ วิธีแก้ไขปัญหาอื่นที่ฉันเห็นคือการเปลี่ยนชื่อแอตทริบิวต์จากผู้ปกครองคนใดคนหนึ่ง แต่เนื่องจากฉันเข้าใจว่าแต่ละอินสแตนซ์ของคลาส D ของฉันจะมีแอตทริบิวต์ที่ไม่มีประโยชน์ซึ่งไม่ใช่สิ่งที่ฉันต้องการ...
Error: Undefine subclause lists name of frozen feature or attribute or
C external.
What to do: unless you can change the status of the feature in the parent,
remove its name from Undefine subclause since it cannot be undefined.
วิธีผสาน 2 คุณลักษณะจากคลาสที่สืบทอดซ้ำๆ
class A
serial: STRING
end -- class A
class B
inherit
A
end -- class B
class C
inherit
A
end -- class C
class D
inherit
B
undefine
serial -- error seems to appear here in that case
end
C
end -- class D
C
ในตัวอย่างและสามารถลบออกได้อย่างปลอดภัย - person Alexander Kogtenkov   schedule 15.10.2019