Temporary disable warning about unchecked reified argument
#KT-10847 Fixed #KT-6484 Reopened
This commit is contained in:
+5
-4
@@ -55,10 +55,11 @@ public class ReifiedTypeParameterSubstitutionChecker implements CallChecker {
|
||||
context.trace.report(
|
||||
Errors.REIFIED_TYPE_FORBIDDEN_SUBSTITUTION.on(getElementToReport(context, parameter.getIndex()), argument));
|
||||
}
|
||||
else if (TypeUtilsKt.unsafeAsReifiedArgument(argument) && !hasPureReifiableAnnotation(parameter)) {
|
||||
context.trace.report(
|
||||
Errors.REIFIED_TYPE_UNSAFE_SUBSTITUTION.on(getElementToReport(context, parameter.getIndex()), argument));
|
||||
}
|
||||
// REIFIED_TYPE_UNSAFE_SUBSTITUTION is temporary disabled because it seems too strict now (see KT-10847)
|
||||
//else if (TypeUtilsKt.unsafeAsReifiedArgument(argument) && !hasPureReifiableAnnotation(parameter)) {
|
||||
// context.trace.report(
|
||||
// Errors.REIFIED_TYPE_UNSAFE_SUBSTITUTION.on(getElementToReport(context, parameter.getIndex()), argument));
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+6
-6
@@ -3,22 +3,22 @@
|
||||
inline fun <reified T> foo() {}
|
||||
|
||||
inline fun <reified F> bar() {
|
||||
foo<<!REIFIED_TYPE_UNSAFE_SUBSTITUTION!>Array<F><!>>()
|
||||
foo<<!REIFIED_TYPE_UNSAFE_SUBSTITUTION!>List<F><!>>()
|
||||
foo<Array<F>>()
|
||||
foo<List<F>>()
|
||||
}
|
||||
|
||||
inline fun <reified E> baz(x: E) {}
|
||||
|
||||
fun test(x: Array<String>, y: Array<*>) {
|
||||
foo<<!REIFIED_TYPE_UNSAFE_SUBSTITUTION!>List<String><!>>()
|
||||
foo<List<String>>()
|
||||
foo<List<*>>()
|
||||
foo<<!REIFIED_TYPE_UNSAFE_SUBSTITUTION!>Map<*, String><!>>()
|
||||
foo<Map<*, String>>()
|
||||
foo<Map<*, *>>()
|
||||
|
||||
foo<<!REIFIED_TYPE_UNSAFE_SUBSTITUTION!>Array<String><!>>()
|
||||
foo<Array<String>>()
|
||||
foo<Array<*>>()
|
||||
|
||||
<!REIFIED_TYPE_UNSAFE_SUBSTITUTION!>baz<!>(x)
|
||||
baz(x)
|
||||
baz(y)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user