Fixed argument for error message 'TYPE_PARAMETER_AS_REIFIED'
This commit is contained in:
+1
-1
@@ -46,7 +46,7 @@ public class ReifiedTypeParameterSubstitutionCheck implements CallResolverExtens
|
|||||||
!((TypeParameterDescriptor) argumentDeclarationDescription).isReified()
|
!((TypeParameterDescriptor) argumentDeclarationDescription).isReified()
|
||||||
) {
|
) {
|
||||||
context.trace.report(
|
context.trace.report(
|
||||||
Errors.TYPE_PARAMETER_AS_REIFIED.on(getCallElement(context), typeArguments.keySet().iterator().next())
|
Errors.TYPE_PARAMETER_AS_REIFIED.on(getCallElement(context), parameter)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else if (KotlinBuiltIns.getInstance().isNothingOrNullableNothing(argument)) {
|
else if (KotlinBuiltIns.getInstance().isNothingOrNullableNothing(argument)) {
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
// !DIAGNOSTICS_NUMBER: 1
|
||||||
|
// !DIAGNOSTICS: TYPE_PARAMETER_AS_REIFIED
|
||||||
|
|
||||||
|
public data class Pair<out A, out B>()
|
||||||
|
|
||||||
|
inline fun <R, reified T> f(): Pair<Array<R>, Array<T>> = throw UnsupportedOperationException()
|
||||||
|
|
||||||
|
fun <A> test(): Pair<Array<String>, Array<A>> = f()
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
<!-- typeParameterAsReified1 -->
|
||||||
|
Cannot use 'T' as reified type parameter. Use a class instead.
|
||||||
@@ -162,6 +162,12 @@ public class DiagnosticMessageTestGenerated extends AbstractDiagnosticMessageTes
|
|||||||
doTest(fileName);
|
doTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("typeParameterAsReified.kt")
|
||||||
|
public void testTypeParameterAsReified() throws Exception {
|
||||||
|
String fileName = JetTestUtils.navigationMetadata("idea/testData/diagnosticMessage/typeParameterAsReified.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("unusedParameter.kt")
|
@TestMetadata("unusedParameter.kt")
|
||||||
public void testUnusedParameter() throws Exception {
|
public void testUnusedParameter() throws Exception {
|
||||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/diagnosticMessage/unusedParameter.kt");
|
String fileName = JetTestUtils.navigationMetadata("idea/testData/diagnosticMessage/unusedParameter.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user