FIR: forbid java.lang.String deprecated constructors #KT-51364 Fixed
This commit is contained in:
+6
@@ -5967,6 +5967,12 @@ public class DiagnosisCompilerFirTestdataTestGenerated extends AbstractDiagnosis
|
||||
runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/SpecialCallsWithLambdas.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("stringConstructors.kt")
|
||||
public void testStringConstructors() throws Exception {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/stringConstructors.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("TypesEligibleForSimpleVisit.kt")
|
||||
public void testTypesEligibleForSimpleVisit() throws Exception {
|
||||
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
FILE: stringConstructors.kt
|
||||
public final val sRef: R|kotlin/reflect/KFunction0<kotlin/String>| = ::R|kotlin/String.String|
|
||||
public get(): R|kotlin/reflect/KFunction0<kotlin/String>|
|
||||
public final val s: R|java/lang/String| = R|java/lang/String.String|(R|kotlin/byteArrayOf|(vararg(Byte(1), Byte(2), Byte(3))), Int(4), Int(5), Int(6))
|
||||
public get(): R|java/lang/String|
|
||||
public final val s2: R|java/lang/String| = Q|java/lang|.R|java/lang/String.String|(R|kotlin/byteArrayOf|(vararg(Byte(1), Byte(2), Byte(3))), Int(4), Int(5), Int(6))
|
||||
public get(): R|java/lang/String|
|
||||
public final val s3: R|kotlin/String| = R|kotlin/text/String|(R|kotlin/byteArrayOf|(vararg(Byte(1), Byte(2), Byte(3))), Int(4), Int(5))
|
||||
public get(): R|kotlin/String|
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
// FULL_JDK
|
||||
|
||||
val sRef = ::String
|
||||
|
||||
// Note: FE 1.0 resolves this to kotlin.text.String() synthetic call with type mismatch on the last argument
|
||||
// May be we (FIR) should migrate to the same behavior
|
||||
// Other properties in this file are resolved similarly in FE 1.0 & FIR
|
||||
val s = <!DEPRECATION!>String<!>(byteArrayOf(1, 2, 3), 4, 5, 6)
|
||||
|
||||
val s2 = java.lang.<!DEPRECATION!>String<!>(byteArrayOf(1, 2, 3), 4, 5, 6)
|
||||
val s3 = String(byteArrayOf(1, 2, 3), 4, 5)
|
||||
+6
@@ -5967,6 +5967,12 @@ public class FirDiagnosticTestGenerated extends AbstractFirDiagnosticTest {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/SpecialCallsWithLambdas.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("stringConstructors.kt")
|
||||
public void testStringConstructors() throws Exception {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/stringConstructors.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("TypesEligibleForSimpleVisit.kt")
|
||||
public void testTypesEligibleForSimpleVisit() throws Exception {
|
||||
|
||||
+6
@@ -5967,6 +5967,12 @@ public class FirDiagnosticsWithLightTreeTestGenerated extends AbstractFirDiagnos
|
||||
runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/SpecialCallsWithLambdas.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("stringConstructors.kt")
|
||||
public void testStringConstructors() throws Exception {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/stringConstructors.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("TypesEligibleForSimpleVisit.kt")
|
||||
public void testTypesEligibleForSimpleVisit() throws Exception {
|
||||
|
||||
@@ -169,9 +169,15 @@ class JvmMappedScope(
|
||||
"",
|
||||
"Lkotlin/ByteArray;IILjava/nio/charset/Charset;",
|
||||
"Lkotlin/ByteArray;Ljava/nio/charset/Charset;",
|
||||
"Lkotlin/ByteArray;III",
|
||||
"Lkotlin/ByteArray;II",
|
||||
"Lkotlin/ByteArray;IILjava/lang/String;",
|
||||
"Lkotlin/ByteArray;I",
|
||||
"Lkotlin/ByteArray;",
|
||||
"Lkotlin/ByteArray;Ljava/lang/String;",
|
||||
"IILkotlin/CharArray;",
|
||||
"Lkotlin/CharArray;",
|
||||
"Lkotlin/CharArray;Z",
|
||||
"Lkotlin/CharArray;II",
|
||||
"Lkotlin/IntArray;II",
|
||||
"Ljava/lang/StringBuffer;",
|
||||
|
||||
Reference in New Issue
Block a user