FIR: Fix NI handling flexible type bounds

This commit is contained in:
Denis Zharkov
2020-02-18 19:54:07 +03:00
parent 2ad8488e6a
commit c8269baa92
2 changed files with 7 additions and 7 deletions
@@ -231,9 +231,9 @@ private fun TypeSystemInferenceExtensionContext.getNestedArguments(type: KotlinT
val stack = ArrayDeque<TypeArgumentMarker>()
when (type) {
is FlexibleType -> {
stack.push(createTypeArgument(type.lowerBound, TypeVariance.INV))
stack.push(createTypeArgument(type.upperBound, TypeVariance.INV))
is FlexibleTypeMarker -> {
stack.push(createTypeArgument(type.lowerBound(), TypeVariance.INV))
stack.push(createTypeArgument(type.upperBound(), TypeVariance.INV))
}
else -> stack.push(createTypeArgument(type, TypeVariance.INV))
}
@@ -253,9 +253,9 @@ private fun TypeSystemInferenceExtensionContext.getNestedArguments(type: KotlinT
result.add(typeProjection)
when (val projectedType = typeProjection.getType()) {
is FlexibleType -> {
addArgumentsToStack(projectedType.lowerBound)
addArgumentsToStack(projectedType.upperBound)
is FlexibleTypeMarker -> {
addArgumentsToStack(projectedType.lowerBound())
addArgumentsToStack(projectedType.upperBound())
}
else -> addArgumentsToStack(projectedType)
}
+1 -1
View File
@@ -7,5 +7,5 @@ import java.util.stream.IntStream
fun main() {
val xs = IntStream.range(0, 10).mapToObj { it.toString() }
.collect(Collectors.toList())
<!UNRESOLVED_REFERENCE!>xs[0]<!>
xs[0]
}