Store SimpleTypeArgumentImpl type projection instead of type reference for better handling star projected type arguments
This commit is contained in:
+1
-1
@@ -404,7 +404,7 @@ class DiagnosticReporterByTrackingStrategy(
|
||||
}
|
||||
|
||||
(position as? ExplicitTypeParameterConstraintPositionImpl)?.let {
|
||||
val typeArgumentReference = (it.typeArgument as SimpleTypeArgumentImpl).typeReference
|
||||
val typeArgumentReference = (it.typeArgument as SimpleTypeArgumentImpl).typeProjection.typeReference ?: return@let
|
||||
val diagnosticFactory = if (isWarning) UPPER_BOUND_VIOLATED_WARNING else UPPER_BOUND_VIOLATED
|
||||
report(diagnosticFactory.on(typeArgumentReference, error.upperKotlinType, error.lowerKotlinType))
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ import org.jetbrains.kotlin.types.expressions.KotlinTypeInfo
|
||||
import org.jetbrains.kotlin.utils.addToStdlib.safeAs
|
||||
|
||||
class SimpleTypeArgumentImpl(
|
||||
val typeReference: KtTypeReference,
|
||||
val typeProjection: KtTypeProjection,
|
||||
override val type: UnwrappedType
|
||||
) : SimpleTypeArgument
|
||||
|
||||
|
||||
@@ -694,7 +694,7 @@ class PSICallResolver(
|
||||
}
|
||||
ModifierCheckerCore.check(projection, context.trace, null, languageVersionSettings)
|
||||
|
||||
resolveType(context, projection.typeReference, typeResolver)?.let { SimpleTypeArgumentImpl(projection.typeReference!!, it) }
|
||||
resolveType(context, projection.typeReference, typeResolver)?.let { SimpleTypeArgumentImpl(projection, it) }
|
||||
?: TypeArgumentPlaceholder
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user