Basic support of partially specified type arguments though a new underscore operator for type arguments
^KT-13394
This commit is contained in:
@@ -150,7 +150,7 @@ object DebugInfoUtil {
|
||||
target = "[" + labelTargets.size + " elements]"
|
||||
}
|
||||
}
|
||||
if (MAY_BE_UNRESOLVED.contains(referencedNameElementType)) {
|
||||
if (MAY_BE_UNRESOLVED.contains(referencedNameElementType) || (expression is KtNameReferenceExpression && expression.isPlaceholder)) {
|
||||
return
|
||||
}
|
||||
val resolved = target != null
|
||||
|
||||
@@ -286,16 +286,24 @@ private fun resolveParametersTypes(
|
||||
}
|
||||
}
|
||||
|
||||
@JvmName("resolveTypeWithGivenTypeReference")
|
||||
internal fun resolveType(
|
||||
context: BasicCallResolutionContext,
|
||||
typeReference: KtTypeReference,
|
||||
typeResolver: TypeResolver
|
||||
): UnwrappedType {
|
||||
val type = typeResolver.resolveType(context.scope, typeReference, context.trace, checkBounds = true)
|
||||
ForceResolveUtil.forceResolveAllContents(type)
|
||||
return type.unwrap()
|
||||
}
|
||||
|
||||
internal fun resolveType(
|
||||
context: BasicCallResolutionContext,
|
||||
typeReference: KtTypeReference?,
|
||||
typeResolver: TypeResolver
|
||||
): UnwrappedType? {
|
||||
if (typeReference == null) return null
|
||||
|
||||
val type = typeResolver.resolveType(context.scope, typeReference, context.trace, checkBounds = true)
|
||||
ForceResolveUtil.forceResolveAllContents(type)
|
||||
return type.unwrap()
|
||||
return resolveType(context, typeReference, typeResolver)
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -687,8 +687,11 @@ class PSICallResolver(
|
||||
}
|
||||
ModifierCheckerCore.check(projection, context.trace, null, languageVersionSettings)
|
||||
|
||||
resolveType(context, projection.typeReference, typeResolver)?.let { SimpleTypeArgumentImpl(projection, it) }
|
||||
?: TypeArgumentPlaceholder
|
||||
val typeReference = projection.typeReference
|
||||
|
||||
if (typeReference == null || typeReference.isPlaceholder) return@map TypeArgumentPlaceholder
|
||||
|
||||
SimpleTypeArgumentImpl(projection, resolveType(context, typeReference, typeResolver))
|
||||
}
|
||||
|
||||
private fun resolveArgumentsInParenthesis(
|
||||
|
||||
Reference in New Issue
Block a user