FIR: Fix NI handling flexible type bounds
This commit is contained in:
+6
-6
@@ -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)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user