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

annotation target for setter property does not work #355

Closed
yigit opened this issue Mar 15, 2021 · 0 comments
Closed

annotation target for setter property does not work #355

yigit opened this issue Mar 15, 2021 · 0 comments

Comments

@yigit
Copy link
Collaborator

yigit commented Mar 15, 2021

For the given code:

               @setparam:SuppressWarnings("onSetterParam3")
                var prop3:Int
                    @OtherAnnotation("_onGetter3")
                    get() = 3

                    @OtherAnnotation("_onSetter3")
                    set(@OtherAnnotation("_onSetterParam3") value) = Unit

When I read the annotation on the value parameter of set, I only receive OtherAnnotation but not the SuppressWarnings coming from the property declaration.

copybara-service bot pushed a commit to androidx/androidx that referenced this issue Mar 16, 2021
KSP alpha05 has some annotation target fixes which breaks Room's
workarounds. Unfortunately, we hit another bug which prevents us from
removing the use site target checks but i needed to change some to
handle the fixes in KSP.
google/ksp#355

Updated XAnnotationBox test to also run with pre-compiled code.
Unfortunately, KSP fails for annotation of annotations case:
google/ksp#356

There is also a recent KSP change to make some methods nullable (jvm
name methods). It is not in alpha05 yet but to future proof room's code,
I changed Room's code to handle them being null (even though compiler
complains, it is the correct change).

Bug: 160322705
Test: existing room tests
Change-Id: I4b88853d06c48cae563a6f3ad7363e6ff4ca0abf
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

2 participants