Report unsupported on using underscored type argument if the corresponding feature is disabled
This commit is contained in:
@@ -691,7 +691,7 @@ class PSICallResolver(
|
|||||||
|
|
||||||
val typeReference = projection.typeReference ?: return@map TypeArgumentPlaceholder
|
val typeReference = projection.typeReference ?: return@map TypeArgumentPlaceholder
|
||||||
|
|
||||||
if (typeReference.isPlaceholder && arePartiallySpecifiedTypeArgumentsEnabled) {
|
if (typeReference.isPlaceholder) {
|
||||||
val resolvedAnnotations = typeResolver.resolveTypeAnnotations(context.trace, context.scope, typeReference)
|
val resolvedAnnotations = typeResolver.resolveTypeAnnotations(context.trace, context.scope, typeReference)
|
||||||
.apply(ForceResolveUtil::forceResolveAllContents)
|
.apply(ForceResolveUtil::forceResolveAllContents)
|
||||||
|
|
||||||
@@ -700,6 +700,10 @@ class PSICallResolver(
|
|||||||
context.trace.report(Errors.UNSUPPORTED.on(annotationElement, "annotations on an underscored type argument"))
|
context.trace.report(Errors.UNSUPPORTED.on(annotationElement, "annotations on an underscored type argument"))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!arePartiallySpecifiedTypeArgumentsEnabled) {
|
||||||
|
context.trace.report(Errors.UNSUPPORTED.on(typeReference, "underscored type argument"))
|
||||||
|
}
|
||||||
|
|
||||||
return@map TypeArgumentPlaceholder
|
return@map TypeArgumentPlaceholder
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
// FIR_IDENTICAL
|
// !LANGUAGE: -PartiallySpecifiedTypeArguments
|
||||||
// !DIAGNOSTICS: -UNCHECKED_CAST
|
// !DIAGNOSTICS: -UNCHECKED_CAST
|
||||||
// WITH_RUNTIME
|
// WITH_RUNTIME
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
|
// !LANGUAGE: -PartiallySpecifiedTypeArguments
|
||||||
// !DIAGNOSTICS: -UNCHECKED_CAST
|
// !DIAGNOSTICS: -UNCHECKED_CAST
|
||||||
// WITH_RUNTIME
|
// WITH_RUNTIME
|
||||||
|
|
||||||
fun <K, T> foo(x: (K) -> T): Pair<K, T> = (1 as K) to (1f as T)
|
fun <K, T> foo(x: (K) -> T): Pair<K, T> = (1 as K) to (1f as T)
|
||||||
|
|
||||||
fun box(): String {
|
fun box(): String {
|
||||||
val x = foo<Int, <!UNRESOLVED_REFERENCE!>_<!>> { it.toFloat() } // Pair<Int, Float>
|
val x = foo<Int, <!UNSUPPORTED("underscored type argument")!>_<!>> { it.toFloat() } // Pair<Int, Float>
|
||||||
return "OK"
|
return "OK"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user