Skip to content

Commit 3eecb21

Browse files
committed
Fix ReduceValueProvider.kt
1 parent 6714e87 commit 3eecb21

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

utbot-python/src/main/kotlin/org/utbot/python/fuzzing/provider/ReduceValueProvider.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,16 @@ class ReduceValueProvider(
1717
private val idGenerator: IdGenerator<Long>
1818
) : ValueProvider<Type, PythonTreeModel, PythonMethodDescription> {
1919
override fun accept(type: Type): Boolean {
20-
val hasInit = type.getPythonAttributes().any { it.name == "__init__" }
20+
val hasInit = type.getPythonAttributes().any { it.name == "__init__" && it.type is FunctionTypeCreator.Original }
2121
return type.meta is PythonConcreteCompositeTypeDescription && hasInit
2222
}
2323

2424
override fun generate(description: PythonMethodDescription, type: Type) = sequence {
2525
val meta = type.meta as PythonConcreteCompositeTypeDescription
2626
val arguments = (type.getPythonAttributes().first { it.name == "__init__" }.type as FunctionTypeCreator.Original).arguments
27+
val nonSelfArgs = arguments.drop(1)
2728
yield(Seed.Recursive(
28-
construct = Routine.Create(arguments) { v ->
29+
construct = Routine.Create(nonSelfArgs) { v ->
2930
PythonTreeModel(
3031
PythonTree.ReduceNode(
3132
idGenerator.createId(),

0 commit comments

Comments
 (0)