diff --git a/ets2panda/checker/ets/object.cpp b/ets2panda/checker/ets/object.cpp index a9e62345acc15565b5e1a0a22c66b43345befd32..ab68d7d3364254578c5b334916f14ea2c07f4c7d 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; }