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
Fix#19951: Align TASTy with the Java annotation model.
Scala annotations are classes, with a real constructor, which has
a real signature where order is relevant but names are irrelevant.
On the contrary, Java annotations are interfaces, without any real
constructors. The names of "fields" are relevant, whereas their
order is irrelevant.
As illustrated by #19951, trying to shoehorn Java annotations into
the Scala annotation model is not sustainable, and breaks in real
ways. Therefore, in this commit we align how Java annotations are
stored in TASTy with the Java annotation model.
During pickling:
* Selection of the constructor is pickled without a signature.
* Default arguments are dropped.
* (Due to the parent commit, all arguments are `NamedArg`s at this point.)
During unpickling:
* Selection of the constructor resolves to the unique constructor
(instead of complaining because a signature-less `SELECT` should
not resolve to a member with a signature).
* Arguments to the constructor are reordered and extended with
defaults to match the target constructor; we can do this because
all the arguments are `NamedArg`s.
For backward compatibility, during unpickling:
* If we read a `SELECTin` for a Java annotation constructor, we
disregard its signature and pretend it was a `SELECT`.
* We adapt arguments in best-effort way if not all of them are
`NamedArg`s.
0 commit comments