FIR: forbid java.lang.String(String) constructor in JvmMappedScope
#KT-49135 Fixed
This commit is contained in:
committed by
TeamCityServer
parent
09bc729b0e
commit
f4067f05a2
+6
@@ -5111,6 +5111,12 @@ public class DiagnosisCompilerFirTestdataTestGenerated extends AbstractDiagnosis
|
|||||||
runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/intellij/PersistentStateComponent.kt");
|
runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/intellij/PersistentStateComponent.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("typeAliasAmbiguity.kt")
|
||||||
|
public void testTypeAliasAmbiguity() throws Exception {
|
||||||
|
runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/intellij/typeAliasAmbiguity.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("UastPatterns.kt")
|
@TestMetadata("UastPatterns.kt")
|
||||||
public void testUastPatterns() throws Exception {
|
public void testUastPatterns() throws Exception {
|
||||||
|
|||||||
+7
@@ -0,0 +1,7 @@
|
|||||||
|
FILE: typeAliasAmbiguity.kt
|
||||||
|
public final typealias ServiceId = R|kotlin/String|
|
||||||
|
public final fun ServiceId(serviceId: R|kotlin/String|): R|ServiceId| {
|
||||||
|
^ServiceId R|<local>/serviceId|
|
||||||
|
}
|
||||||
|
public final val GaugeSpecTmsIntegrationServiceId: R|ServiceId| = R|/ServiceId|(String(Gauge))
|
||||||
|
public get(): R|ServiceId|
|
||||||
+4
@@ -0,0 +1,4 @@
|
|||||||
|
typealias ServiceId = String
|
||||||
|
fun ServiceId(serviceId: String): ServiceId = serviceId
|
||||||
|
// FE 1.0 resolves this to function
|
||||||
|
val GaugeSpecTmsIntegrationServiceId = ServiceId("Gauge")
|
||||||
+6
@@ -5111,6 +5111,12 @@ public class FirDiagnosticTestGenerated extends AbstractFirDiagnosticTest {
|
|||||||
runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/intellij/PersistentStateComponent.kt");
|
runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/intellij/PersistentStateComponent.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("typeAliasAmbiguity.kt")
|
||||||
|
public void testTypeAliasAmbiguity() throws Exception {
|
||||||
|
runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/intellij/typeAliasAmbiguity.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("UastPatterns.kt")
|
@TestMetadata("UastPatterns.kt")
|
||||||
public void testUastPatterns() throws Exception {
|
public void testUastPatterns() throws Exception {
|
||||||
|
|||||||
+6
@@ -5111,6 +5111,12 @@ public class FirDiagnosticsWithLightTreeTestGenerated extends AbstractFirDiagnos
|
|||||||
runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/intellij/PersistentStateComponent.kt");
|
runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/intellij/PersistentStateComponent.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("typeAliasAmbiguity.kt")
|
||||||
|
public void testTypeAliasAmbiguity() throws Exception {
|
||||||
|
runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/intellij/typeAliasAmbiguity.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("UastPatterns.kt")
|
@TestMetadata("UastPatterns.kt")
|
||||||
public void testUastPatterns() throws Exception {
|
public void testUastPatterns() throws Exception {
|
||||||
|
|||||||
@@ -146,6 +146,7 @@ class JvmMappedScope(
|
|||||||
"Lkotlin/IntArray;II",
|
"Lkotlin/IntArray;II",
|
||||||
"Ljava/lang/StringBuffer;",
|
"Ljava/lang/StringBuffer;",
|
||||||
"Ljava/lang/StringBuilder;",
|
"Ljava/lang/StringBuilder;",
|
||||||
|
"Ljava/lang/String;",
|
||||||
).mapTo(this) { arguments -> "java/lang/String.<init>($arguments)V" }
|
).mapTo(this) { arguments -> "java/lang/String.<init>($arguments)V" }
|
||||||
|
|
||||||
listOf(
|
listOf(
|
||||||
|
|||||||
Reference in New Issue
Block a user