[K2/N] Use FqName to mangle invisible class-like symbol in fake override
^KT-57484 Merge-request: KT-MR-10263 Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
This commit is contained in:
committed by
Space Team
parent
548ebbaf90
commit
a534708900
@@ -171,7 +171,7 @@ open class FirMangleComputer(
|
||||
is FirTypeParameterSymbol -> tBuilder.mangleTypeParameterReference(symbol.toLookupTag())
|
||||
// This is performed for a case with invisible class-like symbol in fake override
|
||||
null -> (type.lookupTag as? ConeClassLikeLookupTag)?.let {
|
||||
tBuilder.append(it.classId)
|
||||
tBuilder.append(it.classId.asFqNameString())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+4
-1
@@ -1,13 +1,16 @@
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
// WITH_STDLIB
|
||||
// LINK_VIA_SIGNATURES
|
||||
// DUMP_SIGNATURES
|
||||
|
||||
// MODULE: maven
|
||||
// FILE: MavenProject.kt
|
||||
package maven
|
||||
|
||||
interface MavenProject
|
||||
|
||||
// MODULE: lib(maven)
|
||||
// FILE: lib.kt
|
||||
import maven.MavenProject
|
||||
|
||||
abstract class AbstractMavenImportHandler {
|
||||
abstract fun getOptions(enabledCompilerPlugins: List<String>, compilerPluginOptions: List<String>): List<String>?
|
||||
|
||||
+80
@@ -0,0 +1,80 @@
|
||||
// MODULE: maven
|
||||
// FILE: MavenProject.kt
|
||||
package maven
|
||||
|
||||
// CHECK:
|
||||
// Mangled name: maven.MavenProject
|
||||
// Public signature: maven/MavenProject|null[0]
|
||||
interface MavenProject {
|
||||
|
||||
}
|
||||
|
||||
// MODULE: lib
|
||||
// FILE: lib.kt
|
||||
|
||||
// CHECK:
|
||||
// Mangled name: AbstractMavenImportHandler
|
||||
// Public signature: /AbstractMavenImportHandler|null[0]
|
||||
abstract class AbstractMavenImportHandler {
|
||||
// CHECK:
|
||||
// Mangled name: AbstractMavenImportHandler#<init>(){}
|
||||
// Public signature: /AbstractMavenImportHandler.<init>|-5645683436151566731[0]
|
||||
constructor() /* primary */
|
||||
|
||||
// CHECK JVM_IR:
|
||||
// Mangled name: AbstractMavenImportHandler#getOptions(maven.MavenProject;kotlin.collections.List<kotlin.String>;kotlin.collections.List<kotlin.String>){}kotlin.collections.List<kotlin.String>?
|
||||
// Public signature: /AbstractMavenImportHandler.getOptions|-4460773764155808974[0]
|
||||
// CHECK JS_IR JS_IR_ES6 NATIVE:
|
||||
// Mangled name: AbstractMavenImportHandler#getOptions(maven.MavenProject;kotlin.collections.List<kotlin.String>;kotlin.collections.List<kotlin.String>){}
|
||||
// Public signature: /AbstractMavenImportHandler.getOptions|5665422840163221243[0]
|
||||
protected open fun getOptions(mavenProject: MavenProject, enabledCompilerPlugins: List<String>, compilerPluginOptions: List<String>): List<String>?
|
||||
|
||||
// CHECK JVM_IR:
|
||||
// Mangled name: AbstractMavenImportHandler#getOptions(kotlin.collections.List<kotlin.String>;kotlin.collections.List<kotlin.String>){}kotlin.collections.List<kotlin.String>?
|
||||
// Public signature: /AbstractMavenImportHandler.getOptions|6958005737432622530[0]
|
||||
// CHECK JS_IR JS_IR_ES6 NATIVE:
|
||||
// Mangled name: AbstractMavenImportHandler#getOptions(kotlin.collections.List<kotlin.String>;kotlin.collections.List<kotlin.String>){}
|
||||
// Public signature: /AbstractMavenImportHandler.getOptions|227676264994967555[0]
|
||||
abstract fun getOptions(enabledCompilerPlugins: List<String>, compilerPluginOptions: List<String>): List<String>?
|
||||
|
||||
}
|
||||
|
||||
// MODULE: main
|
||||
// FILE: sam.kt
|
||||
|
||||
// CHECK:
|
||||
// Mangled name: SamWithReceiverMavenProjectImportHandler
|
||||
// Public signature: /SamWithReceiverMavenProjectImportHandler|null[0]
|
||||
class SamWithReceiverMavenProjectImportHandler : AbstractMavenImportHandler {
|
||||
// CHECK:
|
||||
// Mangled name: SamWithReceiverMavenProjectImportHandler#<init>(){}
|
||||
// Public signature: /SamWithReceiverMavenProjectImportHandler.<init>|-5645683436151566731[0]
|
||||
constructor() /* primary */
|
||||
|
||||
// CHECK JVM_IR:
|
||||
// Mangled name: SamWithReceiverMavenProjectImportHandler#getOptions(maven.MavenProject;kotlin.collections.List<kotlin.String>;kotlin.collections.List<kotlin.String>){}kotlin.collections.List<kotlin.String>?
|
||||
// Public signature: /SamWithReceiverMavenProjectImportHandler.getOptions|-4460773764155808974[0]
|
||||
// CHECK JS_IR JS_IR_ES6 NATIVE:
|
||||
// Mangled name: SamWithReceiverMavenProjectImportHandler#getOptions(maven.MavenProject;kotlin.collections.List<kotlin.String>;kotlin.collections.List<kotlin.String>){}
|
||||
// Public signature: /SamWithReceiverMavenProjectImportHandler.getOptions|5665422840163221243[0]
|
||||
protected /* fake */ override fun getOptions(mavenProject: MavenProject, enabledCompilerPlugins: List<String>, compilerPluginOptions: List<String>): List<String>?
|
||||
|
||||
// CHECK JVM_IR:
|
||||
// Mangled name: SamWithReceiverMavenProjectImportHandler#getOptions(kotlin.collections.List<kotlin.String>;kotlin.collections.List<kotlin.String>){}kotlin.collections.List<kotlin.String>?
|
||||
// Public signature: /SamWithReceiverMavenProjectImportHandler.getOptions|6958005737432622530[0]
|
||||
// CHECK JS_IR JS_IR_ES6 NATIVE:
|
||||
// Mangled name: SamWithReceiverMavenProjectImportHandler#getOptions(kotlin.collections.List<kotlin.String>;kotlin.collections.List<kotlin.String>){}
|
||||
// Public signature: /SamWithReceiverMavenProjectImportHandler.getOptions|227676264994967555[0]
|
||||
override fun getOptions(enabledCompilerPlugins: List<String>, compilerPluginOptions: List<String>): List<String>?
|
||||
|
||||
}
|
||||
|
||||
// FILE: main.kt
|
||||
|
||||
// CHECK JVM_IR:
|
||||
// Mangled name: #box(){}kotlin.String
|
||||
// Public signature: /box|-9347091776561469[0]
|
||||
// CHECK JS_IR JS_IR_ES6 NATIVE:
|
||||
// Mangled name: #box(){}
|
||||
// Public signature: /box|2173511048851971368[0]
|
||||
fun box(): String
|
||||
+6
@@ -17673,6 +17673,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
runTest("compiler/testData/codegen/box/fir/notFoundClasses.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("SamWithReceiverMavenProjectImportHandler.kt")
|
||||
public void testSamWithReceiverMavenProjectImportHandler() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/fir/SamWithReceiverMavenProjectImportHandler.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("SuspendExtension.kt")
|
||||
public void testSuspendExtension() throws Exception {
|
||||
|
||||
+2
-2
@@ -70,8 +70,8 @@ internal fun dumpModuleKotlinLike(
|
||||
info.processAllIrModuleFragments(module) { irModuleFragment, moduleName ->
|
||||
val irFiles = irModuleFragment.files
|
||||
val builder = multiModuleInfoDumper.builderForModule(moduleName)
|
||||
val filteredIrFiles = irFiles.groupWithTestFiles(module).filterNot {
|
||||
it.first?.directives?.contains(EXTERNAL_FILE) == true
|
||||
val filteredIrFiles = irFiles.groupWithTestFiles(module).filterNot { (testFile, _) ->
|
||||
testFile?.let { EXTERNAL_FILE in it.directives || it.isAdditional } ?: false
|
||||
}.map { it.second }
|
||||
val printFileName = filteredIrFiles.size > 1 || allModules.size > 1
|
||||
val modifiedOptions = options.copy(printFileName = printFileName)
|
||||
|
||||
+1
-1
@@ -149,7 +149,7 @@ fun TestConfigurationBuilder.commonHandlersForCodegenTest() {
|
||||
}
|
||||
|
||||
fun HandlersStepBuilder<IrBackendInput>.dumpHandlersForConverterStep() {
|
||||
useHandlers(::IrTreeVerifierHandler, ::IrTextDumpHandler)
|
||||
useHandlers(::IrTreeVerifierHandler, ::IrTextDumpHandler, ::IrMangledNameAndSignatureDumpHandler)
|
||||
}
|
||||
|
||||
fun HandlersStepBuilder<BinaryArtifacts.Jvm>.dumpHandlersForBackendStep() {
|
||||
|
||||
+5
@@ -14668,6 +14668,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
||||
runTest("compiler/testData/codegen/box/fir/notFoundClasses.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("SamWithReceiverMavenProjectImportHandler.kt")
|
||||
public void testSamWithReceiverMavenProjectImportHandler() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/fir/SamWithReceiverMavenProjectImportHandler.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("SuspendFunctionReference.kt")
|
||||
public void testSuspendFunctionReference() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/fir/SuspendFunctionReference.kt");
|
||||
|
||||
+4
-1
@@ -12,6 +12,7 @@ import org.jetbrains.kotlin.platform.js.JsPlatforms
|
||||
import org.jetbrains.kotlin.test.Constructor
|
||||
import org.jetbrains.kotlin.test.TargetBackend
|
||||
import org.jetbrains.kotlin.test.backend.BlackBoxCodegenSuppressor
|
||||
import org.jetbrains.kotlin.test.backend.handlers.IrMangledNameAndSignatureDumpHandler
|
||||
import org.jetbrains.kotlin.test.backend.handlers.JsIrInterpreterDumpHandler
|
||||
import org.jetbrains.kotlin.test.backend.handlers.KlibInterpreterDumpHandler
|
||||
import org.jetbrains.kotlin.test.builders.*
|
||||
@@ -112,7 +113,9 @@ abstract class AbstractJsBlackBoxCodegenTestBase<R : ResultingArtifact.FrontendO
|
||||
}
|
||||
|
||||
facadeStep(frontendToBackendConverter)
|
||||
irHandlersStep()
|
||||
irHandlersStep {
|
||||
useHandlers(::IrMangledNameAndSignatureDumpHandler)
|
||||
}
|
||||
|
||||
facadeStep(backendFacade)
|
||||
klibArtifactsHandlersStep()
|
||||
|
||||
+6
@@ -13641,6 +13641,12 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/fir/nestedClassTypeParameterDeserialization.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("SamWithReceiverMavenProjectImportHandler.kt")
|
||||
public void testSamWithReceiverMavenProjectImportHandler() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/fir/SamWithReceiverMavenProjectImportHandler.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("toLong.kt")
|
||||
public void testToLong() throws Exception {
|
||||
|
||||
+6
@@ -13737,6 +13737,12 @@ public class FirJsCodegenBoxTestGenerated extends AbstractFirJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/fir/nestedClassTypeParameterDeserialization.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("SamWithReceiverMavenProjectImportHandler.kt")
|
||||
public void testSamWithReceiverMavenProjectImportHandler() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/fir/SamWithReceiverMavenProjectImportHandler.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("toLong.kt")
|
||||
public void testToLong() throws Exception {
|
||||
|
||||
+6
@@ -13737,6 +13737,12 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/fir/nestedClassTypeParameterDeserialization.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("SamWithReceiverMavenProjectImportHandler.kt")
|
||||
public void testSamWithReceiverMavenProjectImportHandler() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/fir/SamWithReceiverMavenProjectImportHandler.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("toLong.kt")
|
||||
public void testToLong() throws Exception {
|
||||
|
||||
+6
@@ -13737,6 +13737,12 @@ public class IrJsES6CodegenBoxTestGenerated extends AbstractIrJsES6CodegenBoxTes
|
||||
runTest("compiler/testData/codegen/box/fir/nestedClassTypeParameterDeserialization.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("SamWithReceiverMavenProjectImportHandler.kt")
|
||||
public void testSamWithReceiverMavenProjectImportHandler() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/fir/SamWithReceiverMavenProjectImportHandler.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("toLong.kt")
|
||||
public void testToLong() throws Exception {
|
||||
|
||||
+6
@@ -14924,6 +14924,12 @@ public class FirNativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTe
|
||||
runTest("compiler/testData/codegen/box/fir/nestedClassTypeParameterDeserialization.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("SamWithReceiverMavenProjectImportHandler.kt")
|
||||
public void testSamWithReceiverMavenProjectImportHandler() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/fir/SamWithReceiverMavenProjectImportHandler.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("toLong.kt")
|
||||
public void testToLong() throws Exception {
|
||||
|
||||
+6
@@ -15274,6 +15274,12 @@ public class FirNativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenB
|
||||
runTest("compiler/testData/codegen/box/fir/nestedClassTypeParameterDeserialization.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("SamWithReceiverMavenProjectImportHandler.kt")
|
||||
public void testSamWithReceiverMavenProjectImportHandler() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/fir/SamWithReceiverMavenProjectImportHandler.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("toLong.kt")
|
||||
public void testToLong() throws Exception {
|
||||
|
||||
+6
@@ -14750,6 +14750,12 @@ public class NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTest
|
||||
runTest("compiler/testData/codegen/box/fir/nestedClassTypeParameterDeserialization.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("SamWithReceiverMavenProjectImportHandler.kt")
|
||||
public void testSamWithReceiverMavenProjectImportHandler() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/fir/SamWithReceiverMavenProjectImportHandler.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("toLong.kt")
|
||||
public void testToLong() throws Exception {
|
||||
|
||||
+6
@@ -14925,6 +14925,12 @@ public class NativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenBoxT
|
||||
runTest("compiler/testData/codegen/box/fir/nestedClassTypeParameterDeserialization.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("SamWithReceiverMavenProjectImportHandler.kt")
|
||||
public void testSamWithReceiverMavenProjectImportHandler() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/fir/SamWithReceiverMavenProjectImportHandler.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("toLong.kt")
|
||||
public void testToLong() throws Exception {
|
||||
|
||||
Generated
+5
@@ -12188,6 +12188,11 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest
|
||||
runTest("compiler/testData/codegen/box/fir/nestedClassTypeParameterDeserialization.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("SamWithReceiverMavenProjectImportHandler.kt")
|
||||
public void testSamWithReceiverMavenProjectImportHandler() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/fir/SamWithReceiverMavenProjectImportHandler.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("toLong.kt")
|
||||
public void testToLong() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/fir/toLong.kt");
|
||||
|
||||
Reference in New Issue
Block a user