From de7e31327b6d71777480ce7000de5640a6dc077b Mon Sep 17 00:00:00 2001 From: Yury Kamenev Date: Fri, 6 Jan 2023 16:35:25 +0800 Subject: [PATCH] Fixed searching for ambiguous methods in case of presence of inherited one --- .../org/utbot/framework/codegen/tree/ConstructorUtils.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/utbot-framework/src/main/kotlin/org/utbot/framework/codegen/tree/ConstructorUtils.kt b/utbot-framework/src/main/kotlin/org/utbot/framework/codegen/tree/ConstructorUtils.kt index 03a078cc03..f9007a3200 100644 --- a/utbot-framework/src/main/kotlin/org/utbot/framework/codegen/tree/ConstructorUtils.kt +++ b/utbot-framework/src/main/kotlin/org/utbot/framework/codegen/tree/ConstructorUtils.kt @@ -342,8 +342,9 @@ internal fun ClassId.getAmbiguousOverloadsOf(executableId: ExecutableId): Sequen is ConstructorId -> allConstructors } + // We should take here not only declared methods but also inherited return allExecutables.filter { - it.name == executableId.name && it.parameters.size == executableId.executable.parameters.size && it.classId == executableId.classId + it.name == executableId.name && it.parameters.size == executableId.executable.parameters.size } }