You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR fixes a bunch of issues / inconsistencies in constuctor
delcarations.
* changed KSFunctionDeclarationImpl and KSFunctionDeclarationJavaImpl
to return <init> from name if it is constructor for consistency
* added KSFunctionDeclaration.isConstructor extension function for
convenience
* changed getConstructors to simply use
declaredFunctions.filter { it.kind == CONSTURCTOR } for consistency
* updated KSClassDeclarationDescriptorImpl.kt declarations to include
* added synthetic constructors for non-interface classes that do not
have a constructor (including java annotations which do get a
constructor when they are in .class files)
* fixed KSConstructorSyntheticImpl to implement returnType
Fixes: #273Fixes: #114Fixes: #113
Test: constructorDeclarations.kt
Copy file name to clipboardexpand all lines: compiler-plugin/src/main/kotlin/com/google/devtools/ksp/symbol/impl/binary/KSClassDeclarationDescriptorImpl.kt
+7-4
Original file line number
Diff line number
Diff line change
@@ -78,7 +78,11 @@ class KSClassDeclarationDescriptorImpl private constructor(val descriptor: Class
78
78
}
79
79
80
80
overrideval declarations:List<KSDeclaration> by lazy {
Copy file name to clipboardexpand all lines: compiler-plugin/src/main/kotlin/com/google/devtools/ksp/symbol/impl/binary/KSFunctionDeclarationDescriptorImpl.kt
Copy file name to clipboardexpand all lines: compiler-plugin/src/main/kotlin/com/google/devtools/ksp/symbol/impl/java/KSClassDeclarationJavaEnumEntryImpl.kt
+1-1
Original file line number
Diff line number
Diff line change
@@ -65,7 +65,7 @@ class KSClassDeclarationJavaEnumEntryImpl private constructor(val psi: PsiEnumCo
Copy file name to clipboardexpand all lines: compiler-plugin/src/main/kotlin/com/google/devtools/ksp/symbol/impl/synthetic/KSConstructorSyntheticImpl.kt
+3-1
Original file line number
Diff line number
Diff line change
@@ -54,7 +54,9 @@ class KSConstructorSyntheticImpl(val ksClassDeclaration: KSClassDeclaration) : K
0 commit comments