Skip to content

Commit a3125b1

Browse files
authored
Fixed bug in HintCollector (#1962)
1 parent c3feb6a commit a3125b1

File tree

1 file changed

+5
-3
lines changed
  • utbot-python/src/main/kotlin/org/utbot/python/newtyping/ast/visitor/hints

1 file changed

+5
-3
lines changed

utbot-python/src/main/kotlin/org/utbot/python/newtyping/ast/visitor/hints/HintCollector.kt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,13 @@ class HintCollector(
102102
}
103103
if (processIsinstanceCall(parsed, node))
104104
return
105-
val type = mypyTypes[parsed.function.beginOffset to parsed.function.endOffset]
106-
val typeDescription = type?.getPythonAttributeByName(
105+
val rawType = mypyTypes[parsed.function.beginOffset to parsed.function.endOffset]
106+
val attr = rawType?.getPythonAttributeByName(
107107
storage,
108108
"__call__"
109-
)?.type?.pythonDescription()
109+
)
110+
val type = attr?.type
111+
val typeDescription = type?.pythonDescription()
110112
val callType = createPythonCallableType(
111113
parsed.args.size,
112114
List(parsed.args.size) { PythonCallableTypeDescription.ArgKind.ARG_POS },

0 commit comments

Comments
 (0)