Remove TypeOfChecker for JVM frontend
This is needed to support typeOf with non-reified type parameters. #KT-30279
This commit is contained in:
-5
@@ -2439,11 +2439,6 @@ public class FirOldFrontendDiagnosticsTestWithStdlibGenerated extends AbstractFi
|
||||
public void testNoReflectionInClassPath() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/reflection/noReflectionInClassPath.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("typeOfWithNonReifiedParameter.kt")
|
||||
public void testTypeOfWithNonReifiedParameter() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/reflection/typeOfWithNonReifiedParameter.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/diagnostics/testsWithStdLib/regression")
|
||||
|
||||
@@ -48,7 +48,7 @@ private val DEFAULT_CALL_CHECKERS = listOf(
|
||||
UnderscoreUsageChecker, AssigningNamedArgumentToVarargChecker(), ImplicitNothingAsTypeParameterCallChecker,
|
||||
PrimitiveNumericComparisonCallChecker, LambdaWithSuspendModifierCallChecker,
|
||||
UselessElvisCallChecker(), ResultTypeWithNullableOperatorsChecker(), NullableVarargArgumentCallChecker,
|
||||
NamedFunAsExpressionChecker, ContractNotAllowedCallChecker, ReifiedTypeParameterSubstitutionChecker(), TypeOfChecker,
|
||||
NamedFunAsExpressionChecker, ContractNotAllowedCallChecker, ReifiedTypeParameterSubstitutionChecker(),
|
||||
MissingDependencySupertypeChecker.ForCalls, AbstractClassInstantiationChecker,
|
||||
)
|
||||
private val DEFAULT_TYPE_CHECKERS = emptyList<AdditionalTypeChecker>()
|
||||
|
||||
Vendored
-35
@@ -1,35 +0,0 @@
|
||||
// !USE_EXPERIMENTAL: kotlin.ExperimentalStdlibApi
|
||||
// !LANGUAGE: +ProhibitNonReifiedArraysAsReifiedTypeArguments
|
||||
|
||||
import kotlin.reflect.typeOf
|
||||
|
||||
inline fun <X, reified Y, Z : Y> test1() {
|
||||
typeOf<X>()
|
||||
typeOf<List<X>>()
|
||||
typeOf<Array<X?>>()
|
||||
|
||||
typeOf<Y>()
|
||||
|
||||
typeOf<Z>()
|
||||
typeOf<List<Z>?>()
|
||||
typeOf<Array<Z>>()
|
||||
}
|
||||
|
||||
|
||||
class Test2<W> {
|
||||
fun test2() {
|
||||
typeOf<W>()
|
||||
typeOf<List<W?>>()
|
||||
typeOf<Array<W>>()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
inline fun <reified U> f() {
|
||||
typeOf<U>()
|
||||
}
|
||||
|
||||
fun <T> test3() {
|
||||
// We don't report anything here because we can't know in frontend how the corresponding type parameter is used in f
|
||||
f<List<T>>()
|
||||
}
|
||||
+5
@@ -1074,5 +1074,10 @@ public class DiagnosticsTestWithJsStdLibGenerated extends AbstractDiagnosticsTes
|
||||
public void testReflectionApi() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/testsWithJsStdLib/reflection/reflectionApi.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("typeOfWithNonReifiedParameter.kt")
|
||||
public void testTypeOfWithNonReifiedParameter() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/testsWithJsStdLib/reflection/typeOfWithNonReifiedParameter.kt");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
-5
@@ -3454,11 +3454,6 @@ public class DiagnosticsTestWithStdLibGenerated extends AbstractDiagnosticsTestW
|
||||
public void testNoReflectionInClassPath() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/reflection/noReflectionInClassPath.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("typeOfWithNonReifiedParameter.kt")
|
||||
public void testTypeOfWithNonReifiedParameter() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/reflection/typeOfWithNonReifiedParameter.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/diagnostics/testsWithStdLib/regression")
|
||||
|
||||
compiler/tests/org/jetbrains/kotlin/checkers/javac/DiagnosticsTestWithStdLibUsingJavacGenerated.java
Generated
-5
@@ -3454,11 +3454,6 @@ public class DiagnosticsTestWithStdLibUsingJavacGenerated extends AbstractDiagno
|
||||
public void testNoReflectionInClassPath() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/reflection/noReflectionInClassPath.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("typeOfWithNonReifiedParameter.kt")
|
||||
public void testTypeOfWithNonReifiedParameter() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/reflection/typeOfWithNonReifiedParameter.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/diagnostics/testsWithStdLib/regression")
|
||||
|
||||
Reference in New Issue
Block a user