New J2K: fix SOE in inference processing for star-projection as type argument
#KT-33942 fixed #KT-33941 fixed
This commit is contained in:
+6
-5
@@ -204,16 +204,17 @@ open class BoundTypeCalculatorImpl(
|
|||||||
BoundTypeImpl(
|
BoundTypeImpl(
|
||||||
typeVariable?.let { TypeVariableLabel(it) } ?: GenericLabel(target.classReference),
|
typeVariable?.let { TypeVariableLabel(it) } ?: GenericLabel(target.classReference),
|
||||||
arguments.mapIndexed { i, argument ->
|
arguments.mapIndexed { i, argument ->
|
||||||
TypeParameter(
|
val argumentBoundType = when {
|
||||||
argument.type.boundTypeUnenhanced(
|
argument.isStarProjection -> BoundType.STAR_PROJECTION
|
||||||
|
else -> argument.type.boundTypeUnenhanced(
|
||||||
typeVariable?.typeParameters?.getOrNull(i)?.boundType?.label?.safeAs<TypeVariableLabel>()?.typeVariable,
|
typeVariable?.typeParameters?.getOrNull(i)?.boundType?.label?.safeAs<TypeVariableLabel>()?.typeVariable,
|
||||||
contextBoundType,
|
contextBoundType,
|
||||||
call,
|
call,
|
||||||
isImplicitReceiver,
|
isImplicitReceiver,
|
||||||
inferenceContext
|
inferenceContext
|
||||||
) ?: return null,
|
) ?: return null
|
||||||
constructor.parameters[i].variance
|
}
|
||||||
)
|
TypeParameter(argumentBoundType, constructor.parameters[i].variance)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -7,7 +7,7 @@ import java.util.stream.Stream
|
|||||||
fun test(list: /*T1@*/List</*T0@*/String>) {
|
fun test(list: /*T1@*/List</*T0@*/String>) {
|
||||||
val x: /*T9@*/List</*T8@*/String> = list/*T1@List<T0@String>*/.stream()/*Stream<T0@String>!!L*/
|
val x: /*T9@*/List</*T8@*/String> = list/*T1@List<T0@String>*/.stream()/*Stream<T0@String>!!L*/
|
||||||
.map</*T3@*/String>({ x: /*T2@*/String -> x/*T2@String*/ + ""/*LIT*//*LIT*/ }/*Function1<T2@String, T10@String>!!L*/)/*Stream<T3@String>*/
|
.map</*T3@*/String>({ x: /*T2@*/String -> x/*T2@String*/ + ""/*LIT*//*LIT*/ }/*Function1<T2@String, T10@String>!!L*/)/*Stream<T3@String>*/
|
||||||
.collect</*T6@*/List</*T5@*/String>, /*T7@*/Any>(Collectors/*LIT*/.toList</*T4@*/String>()/*Collector<T4@String, Any, MutableList<T4@String>>*/)/*T6@List<T5@String>*/
|
.collect</*T6@*/List</*T5@*/String>, /*T7@*/Any>(Collectors/*LIT*/.toList</*T4@*/String>()/*Collector<T4@String, *, MutableList<T4@String>>*/)/*T6@List<T5@String>*/
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user