Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

explicit constructor is missing in compiled java dependencies #273

Closed
yigit opened this issue Jan 28, 2021 · 1 comment
Closed

explicit constructor is missing in compiled java dependencies #273

yigit opened this issue Jan 28, 2021 · 1 comment

Comments

@yigit
Copy link
Collaborator

yigit commented Jan 28, 2021

Seems like when a dependency has a java class with an excplicit constructor, it doesn't get reported from ksp.

repro: yigit@3c43627

Will work on the fix, not sure what is happening right now.

@yigit
Copy link
Collaborator Author

yigit commented Jan 28, 2021

yigit added a commit to yigit/ksp that referenced this issue Jan 28, 2021
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: google#273
Fixes: google#114
Fixes: google#113
Test: constructorDeclarations.kt
copybara-service bot pushed a commit to androidx/androidx that referenced this issue Feb 6, 2021
* Removed workarounds in KspTypeElement about detecting constructors
since KSP now has an API to get check if a function is a constructor
* Removed the workaround for google/ksp#175
which seems to be working now. Instead, now we revert some override
calls if its jvm signatures won't match.
* Updated ksp integration test (room kotlin test app) to use the new
kspAndroidTest conffiguration.
* Removed the workaround for google/ksp#173
* Re-enabled @generated annotation for KSP:
  google/ksp#198
* Removed the log for https://github.com/android/kotlin/issues/133
  We'll still use custom logic because calling KSP will invoke the
descriptor APIs and current implementation is working fine.
* Fallback location test now also checks the KSP constructor case
 google/ksp#273

Bug: 160322705
Test: existing tests
Change-Id: I1aef81b0c7475a86d40d38456e765a469ca79de6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant