From 40905c2728f070f5bb8de905674110fec5b9d75c Mon Sep 17 00:00:00 2001 From: Jiaxiang Chen Date: Tue, 29 Mar 2022 11:33:00 -0700 Subject: [PATCH] synthetic constructors should have null qualified name, to align with non synthetic constructors --- .../ksp/symbol/impl/synthetic/KSConstructorSyntheticImpl.kt | 4 +--- compiler-plugin/testData/api/declarationUtil.kt | 4 ++-- compiler-plugin/testData/api/libOrigins.kt | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/compiler-plugin/src/main/kotlin/com/google/devtools/ksp/symbol/impl/synthetic/KSConstructorSyntheticImpl.kt b/compiler-plugin/src/main/kotlin/com/google/devtools/ksp/symbol/impl/synthetic/KSConstructorSyntheticImpl.kt index 4696cde464..2abd847d75 100644 --- a/compiler-plugin/src/main/kotlin/com/google/devtools/ksp/symbol/impl/synthetic/KSConstructorSyntheticImpl.kt +++ b/compiler-plugin/src/main/kotlin/com/google/devtools/ksp/symbol/impl/synthetic/KSConstructorSyntheticImpl.kt @@ -42,9 +42,7 @@ class KSConstructorSyntheticImpl(val ksClassDeclaration: KSClassDeclaration) : override val functionKind: FunctionKind = FunctionKind.MEMBER - override val qualifiedName: KSName? by lazy { - KSNameImpl.getCached(ksClassDeclaration.qualifiedName?.asString()?.plus(".") ?: "") - } + override val qualifiedName: KSName? = null override val simpleName: KSName by lazy { KSNameImpl.getCached("") diff --git a/compiler-plugin/testData/api/declarationUtil.kt b/compiler-plugin/testData/api/declarationUtil.kt index 368fb79984..8d88b3560a 100644 --- a/compiler-plugin/testData/api/declarationUtil.kt +++ b/compiler-plugin/testData/api/declarationUtil.kt @@ -46,9 +46,9 @@ // NestedClassSubjects.NestedOpenClass.field: public // NestedClassSubjects.NestedInterface: public open // SealedBase: public open -// SealedBase.: public +// SealedBase / : public // SealedImpl: public -// SealedImpl.: public +// SealedImpl / : public // END // FILE: a.kt internal class Cls(override val b: Int) : ITF { diff --git a/compiler-plugin/testData/api/libOrigins.kt b/compiler-plugin/testData/api/libOrigins.kt index 20575209f1..a6e2ec7348 100644 --- a/compiler-plugin/testData/api/libOrigins.kt +++ b/compiler-plugin/testData/api/libOrigins.kt @@ -110,6 +110,7 @@ // classifier ref: T4: JAVA // classifier ref: T4: JAVA // declaration: : KOTLIN +// declaration: : SYNTHETIC // declaration: T3: KOTLIN // declaration: foo.bar.Anno1.: KOTLIN_LIB // declaration: foo.bar.Anno1: KOTLIN_LIB @@ -126,7 +127,6 @@ // declaration: foo.bar.JavaLib.javaLibField: JAVA_LIB // declaration: foo.bar.JavaLib.javaLibFunction: JAVA_LIB // declaration: foo.bar.JavaLib: JAVA_LIB -// declaration: foo.bar.JavaSrc.: SYNTHETIC // declaration: foo.bar.JavaSrc.LinkedList: JAVA // declaration: foo.bar.JavaSrc.f2: JAVA // declaration: foo.bar.JavaSrc.javaSrcField: JAVA