-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Support use-site meta-annotations #16445
Conversation
Doesn't have a test for #15318 actually, and looking at it it uses |
Co-Authored-By: Guillaume Martres <[email protected]>
3a3ecf7
to
6d3ee4a
Compare
Next to fix the symbol positions of the copied annotations under -Ytest-pickler......... |
4bf54d5
to
48a7d11
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a removeUnwantedAnnotations
in Memoize.scala
as well. Should it be affected?
aa1bc24
to
fa6326a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM otherwise
!annotSym.annotations.exists(metaAnnot => defn.FieldAccessorMetaAnnots.contains(metaAnnot.symbol)) | ||
}) | ||
annot.hasOneOfMetaAnnotation(metaAnnotSym, metaAnnotSymBackup) | ||
|| keepIfNoRelevantAnnot && !annot.hasOneOfMetaAnnotation(defn.NonBeanMetaAnnots.toList*) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why exclude "bean" meta annotations here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This runs before bean getters and setters are created. So if we lose the @beanGetter
/@beanSetter
-annotated annotations on the regular class vals, e.g.:
@(JsonProperty @beanGetter) @BeanProperty val beanGet: String = ""
Then they'll never be copied over onto the def getBeanGet: String = ...
we're about to syntheses.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In Memoize, where we split vals into fields and re-written getters/setters, we now also drop annotations that are beanGetter/Setter
annotated, from the field, and keep only @getter/@setter
-annotated annotations on the (non-bean) getters/setters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 thanks
Workaround issue with annotations covered by scala/scala3#12492, fixed with scala/scala3#16445 This commit can be reverted as soon as the fix is released (according to https://github.com/lampepfl/dotty/releases this is not yet the case)
Workaround issue with annotations covered by scala/scala3#12492, fixed with scala/scala3#16445 This commit can be reverted as soon as the fix is released (according to https://github.com/lampepfl/dotty/releases this is not yet the case)
Workaround issue with annotations covered by scala/scala3#12492, fixed with scala/scala3#16445 This commit can be reverted as soon as the fix is released (according to https://github.com/lampepfl/dotty/releases this is not yet the case)
Fixes #12492
Fixes #15318