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!