From e5f644a64a67300a60fc3521032556792b568428 Mon Sep 17 00:00:00 2001 From: Denis Zharkov Date: Mon, 1 Feb 2016 10:39:19 +0300 Subject: [PATCH] Temporary disable warning about unchecked reified argument #KT-10847 Fixed #KT-6484 Reopened --- .../ReifiedTypeParameterSubstitutionChecker.java | 9 +++++---- .../generics/tpAsReified/GenericAsReifiedArgument.kt | 12 ++++++------ 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/checkers/ReifiedTypeParameterSubstitutionChecker.java b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/checkers/ReifiedTypeParameterSubstitutionChecker.java index ae0dfb8e457..a307ac0a28a 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/checkers/ReifiedTypeParameterSubstitutionChecker.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/checkers/ReifiedTypeParameterSubstitutionChecker.java @@ -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)); + //} } } diff --git a/compiler/testData/diagnostics/tests/generics/tpAsReified/GenericAsReifiedArgument.kt b/compiler/testData/diagnostics/tests/generics/tpAsReified/GenericAsReifiedArgument.kt index 1869f86a885..b201042e828 100644 --- a/compiler/testData/diagnostics/tests/generics/tpAsReified/GenericAsReifiedArgument.kt +++ b/compiler/testData/diagnostics/tests/generics/tpAsReified/GenericAsReifiedArgument.kt @@ -3,22 +3,22 @@ inline fun foo() {} inline fun bar() { - foo<Array>() - foo<List>() + foo>() + foo>() } inline fun baz(x: E) {} fun test(x: Array, y: Array<*>) { - foo<List>() + foo>() foo>() - foo<Map<*, String>>() + foo>() foo>() - foo<Array>() + foo>() foo>() - baz(x) + baz(x) baz(y) }