Add missed type arguments for a star projection into the enhanced type arguments list
This commit is contained in:
+9
-9
@@ -254,17 +254,17 @@ class JavaNullabilityChecker : AdditionalTypeChecker {
|
|||||||
null
|
null
|
||||||
}
|
}
|
||||||
|
|
||||||
@OptIn(ExperimentalStdlibApi::class)
|
|
||||||
private fun enhanceTypeArguments(arguments: List<TypeProjection>) =
|
private fun enhanceTypeArguments(arguments: List<TypeProjection>) =
|
||||||
buildList {
|
arguments.map { argument ->
|
||||||
for (argument in arguments) {
|
// TODO: think about star projections with enhancement (e.g. came from Java: Foo<@NotNull ?>)
|
||||||
// TODO: think about star projections with enhancement (e.g. came from Java: Foo<@NotNull ?>)
|
if (argument.isStarProjection) {
|
||||||
if (argument.isStarProjection) continue
|
return@map argument
|
||||||
val argumentType = argument.type
|
|
||||||
val enhancedArgumentType = if (argumentType is TypeWithEnhancement) argumentType.enhancement else argumentType
|
|
||||||
val enhancedDeeplyArgumentType = buildTypeWithEnhancement(enhancedArgumentType)
|
|
||||||
add(argument.replaceType(enhancedDeeplyArgumentType))
|
|
||||||
}
|
}
|
||||||
|
val argumentType = argument.type
|
||||||
|
val enhancedArgumentType = if (argumentType is TypeWithEnhancement) argumentType.enhancement else argumentType
|
||||||
|
val enhancedDeeplyArgumentType = buildTypeWithEnhancement(enhancedArgumentType)
|
||||||
|
|
||||||
|
argument.replaceType(enhancedDeeplyArgumentType)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun buildTypeWithEnhancement(type: KotlinType): KotlinType {
|
fun buildTypeWithEnhancement(type: KotlinType): KotlinType {
|
||||||
|
|||||||
Reference in New Issue
Block a user