-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix #8531: Annnotations on class value parameters go to the constructor #8534
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
Conversation
361d078
to
94362b7
Compare
This annotation used to be called @transientParam but that's no longer the case.
94362b7
to
6163f77
Compare
…onstructor ...and not to the fields. This matches the behavior of Scala 2. See scala/scala3#8534.
6163f77
to
025bb1f
Compare
/cc @milessabin This PR required a small change in shapeless: dotty-staging/shapeless@d41323c. Once this is merged and a new nightly is published, I could make a PR against your shapeless-3 branch to get this upstream, would that be convenient for you ? |
…tructor Mimic the behavior of Scala 2: an annotation on a class value parameters (but not on a type parameter) is moved to the constructor parameter and not to any of the derived parameters. This required adapting the semanticdb extractor to go look for annotations in constructor parameters too.
Also added `primaryConstructor` to the reflection API for convenience.
025bb1f
to
f5e2f1b
Compare
@odersky @nicolasstucki The signature of paramSymss is: def paramSymss(using ctx: Context): (List[TypeSymbol], List[List[TermSymbol]]) This assumes that we only have one type parameter list which might not be correct in the future, this is especially problematic since we're exposing this API via tasty-reflect, so we need something future-proof. I suggest: def paramSymss(using ctx: Context): List[List[Symbol]] |
We agreed to this in a meeting, I'll do the change. |
💯 |
…onstructor ...and not to the fields. This matches the behavior of Scala 2. See scala/scala3#8534.
Mimic the behavior of Scala 2: an annotation on a class value
parameters (but not on a type parameter) is moved to the constructor
parameter and not to any of the derived parameters.