Temporary disable warning about unchecked reified argument

#KT-10847 Fixed
 #KT-6484 Reopened
This commit is contained in:
Denis Zharkov
2016-02-01 10:39:19 +03:00
parent b0c808082f
commit e5f644a64a
2 changed files with 11 additions and 10 deletions
@@ -55,10 +55,11 @@ public class ReifiedTypeParameterSubstitutionChecker implements CallChecker {
context.trace.report( context.trace.report(
Errors.REIFIED_TYPE_FORBIDDEN_SUBSTITUTION.on(getElementToReport(context, parameter.getIndex()), argument)); Errors.REIFIED_TYPE_FORBIDDEN_SUBSTITUTION.on(getElementToReport(context, parameter.getIndex()), argument));
} }
else if (TypeUtilsKt.unsafeAsReifiedArgument(argument) && !hasPureReifiableAnnotation(parameter)) { // REIFIED_TYPE_UNSAFE_SUBSTITUTION is temporary disabled because it seems too strict now (see KT-10847)
context.trace.report( //else if (TypeUtilsKt.unsafeAsReifiedArgument(argument) && !hasPureReifiableAnnotation(parameter)) {
Errors.REIFIED_TYPE_UNSAFE_SUBSTITUTION.on(getElementToReport(context, parameter.getIndex()), argument)); // context.trace.report(
} // Errors.REIFIED_TYPE_UNSAFE_SUBSTITUTION.on(getElementToReport(context, parameter.getIndex()), argument));
//}
} }
} }
@@ -3,22 +3,22 @@
inline fun <reified T> foo() {} inline fun <reified T> foo() {}
inline fun <reified F> bar() { inline fun <reified F> bar() {
foo<<!REIFIED_TYPE_UNSAFE_SUBSTITUTION!>Array<F><!>>() foo<Array<F>>()
foo<<!REIFIED_TYPE_UNSAFE_SUBSTITUTION!>List<F><!>>() foo<List<F>>()
} }
inline fun <reified E> baz(x: E) {} inline fun <reified E> baz(x: E) {}
fun test(x: Array<String>, y: Array<*>) { fun test(x: Array<String>, y: Array<*>) {
foo<<!REIFIED_TYPE_UNSAFE_SUBSTITUTION!>List<String><!>>() foo<List<String>>()
foo<List<*>>() foo<List<*>>()
foo<<!REIFIED_TYPE_UNSAFE_SUBSTITUTION!>Map<*, String><!>>() foo<Map<*, String>>()
foo<Map<*, *>>() foo<Map<*, *>>()
foo<<!REIFIED_TYPE_UNSAFE_SUBSTITUTION!>Array<String><!>>() foo<Array<String>>()
foo<Array<*>>() foo<Array<*>>()
<!REIFIED_TYPE_UNSAFE_SUBSTITUTION!>baz<!>(x) baz(x)
baz(y) baz(y)
} }