Properties validation in subclass with multiple superclass but same ancestor
댓글 수: 3
Hi @Jacorem,
From what I can see in your code, since both bike and electricalVehicle ultimately inherit from the same vehicle class where required_staff is defined, MATLAB should recognize it's the same property validation rather than treating it as conflicting validations.
A few potential workarounds you might consider:
*Define the property validation in an intermediate class that both inheritance paths go through.
*Use composition instead of multiple inheritance for one of the paths.
*Override the property validation in your concrete class explicitly.
Matt J's comment about this potentially being a documentation vs. implementation issue sounds plausible - it might be worth filing a bug report with MathWorks to get clarification on whether this is intended behavior or a bug.
You might also get more targeted help from MATLAB's technical support since this seems like it could be a edge case in their inheritance implementation. Hope this helps.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Subclass Definition에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!