From 861937848a70446b58a7cb902f129b880fc41a18 Mon Sep 17 00:00:00 2001 From: furkanocalan Date: Mon, 8 Sep 2025 11:53:03 +0300 Subject: [PATCH] Interface inheritance overriding check Issue: #ICWXQH Description: Fix compiler behavior for interface inheritance where two interfaces declare methods with the same name. Signed-off-by: furkanocalan --- ets2panda/checker/ets/object.cpp | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/ets2panda/checker/ets/object.cpp b/ets2panda/checker/ets/object.cpp index a9e62345ac..ab68d7d336 100644 --- a/ets2panda/checker/ets/object.cpp +++ b/ets2panda/checker/ets/object.cpp @@ -917,15 +917,6 @@ ArenaVector &ETSChecker::GetAbstractsForClass(ETSObjectType * }); } -static bool CheckIfInterfaceCanBeFoundOnDifferentPaths(const ETSObjectType *classType, - const ETSObjectType *interfaceType, const ETSChecker *checker) -{ - return std::count_if(classType->Interfaces().begin(), classType->Interfaces().end(), - [&interfaceType, checker](auto *it) { - return DoObjectImplementInterface(it, interfaceType, checker); - }) == 1; -} - void ETSChecker::GetInterfacesOfClass(ETSObjectType *type, ArenaVector &interfaces) { for (auto &classInterface : type->Interfaces()) { @@ -942,8 +933,7 @@ void ETSChecker::CheckIfOverrideIsValidInInterface(ETSObjectType *classType, Sig if (AreOverrideCompatible(sigFunc, sig) && sigFunc->Function()->IsStatic() == sig->Function()->IsStatic()) { SavedTypeRelationFlagsContext const savedFlags(Relation(), Relation()->GetTypeRelationFlags() | TypeRelationFlag::IGNORE_TYPE_PARAMETERS); - if (CheckIfInterfaceCanBeFoundOnDifferentPaths(classType, sigFunc->Owner(), this) && - (Relation()->IsSupertypeOf(sigFunc->Owner(), sig->Owner()) || + if ((Relation()->IsSupertypeOf(sigFunc->Owner(), sig->Owner()) || Relation()->IsSupertypeOf(sig->Owner(), sigFunc->Owner()))) { return; } -- Gitee