Skip to content

Commit b013f99

Browse files
tochilinakzishkaz
authored andcommitted
New version of mypy runner
1 parent 1c99beb commit b013f99

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

utbot-python/src/main/kotlin/org/utbot/python/newtyping/AnnotationFromMypy.kt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ class VarDefinition(
6969
class ExpressionTypeFromMypy(
7070
val startOffset: Long,
7171
val endOffset: Long,
72+
val line: Long,
7273
val type: MypyAnnotation
7374
)
7475

@@ -99,6 +100,9 @@ class MypyAnnotationStorage(
99100
initAnnotation(it.annotation)
100101
}
101102
}
103+
types.values.flatten().forEach {
104+
initAnnotation(it.type)
105+
}
102106
nodeStorage.values.forEach { node ->
103107
node.storage = this
104108
node.children.forEach { initAnnotation(it) }
@@ -128,7 +132,7 @@ class MypyAnnotation(
128132
)
129133
}
130134
return origin
131-
}
135+
}
132136
}
133137

134138
sealed class PythonAnnotationNode {
@@ -247,7 +251,7 @@ class TypeVarNode(
247251
get() = super.children + values + (upperBound?.let { listOf(it) } ?: emptyList())
248252
override fun initializeType() =
249253
error("Initialization of TypeVar must be done in defining class or function." +
250-
" TypeVar name: $varName, def_id: $def")
254+
" TypeVar name: $varName, def_id: $def")
251255
val constraints: Set<TypeParameterConstraint> by lazy {
252256
val upperBoundConstraint: Set<TypeParameterConstraint> =
253257
upperBound?.let { setOf(TypeParameterConstraint(upperBoundRelation, it.asUtBotType)) } ?: emptySet()

0 commit comments

Comments
 (0)