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>() val stack = ArrayDeque<TypeArgumentMarker>()
when (type) { when (type) {
is FlexibleType -> { is FlexibleTypeMarker -> {
stack.push(createTypeArgument(type.lowerBound, TypeVariance.INV)) stack.push(createTypeArgument(type.lowerBound(), TypeVariance.INV))
stack.push(createTypeArgument(type.upperBound, TypeVariance.INV)) stack.push(createTypeArgument(type.upperBound(), TypeVariance.INV))
} }
else -> stack.push(createTypeArgument(type, TypeVariance.INV)) else -> stack.push(createTypeArgument(type, TypeVariance.INV))
} }
@@ -253,9 +253,9 @@ private fun TypeSystemInferenceExtensionContext.getNestedArguments(type: KotlinT
result.add(typeProjection) result.add(typeProjection)
when (val projectedType = typeProjection.getType()) { when (val projectedType = typeProjection.getType()) {
is FlexibleType -> { is FlexibleTypeMarker -> {
addArgumentsToStack(projectedType.lowerBound) addArgumentsToStack(projectedType.lowerBound())
addArgumentsToStack(projectedType.upperBound) addArgumentsToStack(projectedType.upperBound())
} }
else -> addArgumentsToStack(projectedType) else -> addArgumentsToStack(projectedType)
} }
+1 -1
View File
@@ -7,5 +7,5 @@ import java.util.stream.IntStream
fun main() { fun main() {
val xs = IntStream.range(0, 10).mapToObj { it.toString() } val xs = IntStream.range(0, 10).mapToObj { it.toString() }
.collect(Collectors.toList()) .collect(Collectors.toList())
<!UNRESOLVED_REFERENCE!>xs[0]<!> xs[0]
} }