Skip to content

Conversation

@ecrabor8
Copy link

@ecrabor8 ecrabor8 commented Jan 4, 2026

This PR fixes issue #22991 by retaining parameter annotations in mixin phase
generation of forwarder methods.
Therefore, a trait method parameter annotated with Java RetentionPolicy.RUNTIME
annotation is retained in the subclasses .class file in same named method/parameter
for Java reflection use.
This restores the behavior of Scala 2 for such RUNTIME annotated paramters.

Closes ticket #22991

Note -- This is one of two PR choices that fix the issue. Consider this one as first cut with simplest set of changes.

Fixes #22991

…ding methods

    This PR fixes issue scala#22991 by retaining parameter annotations in mixin phase
    generation of forwarder methods.
    Therefore, a trait method parameter annotated with Java RetentionPolicy.RUNTIME
    annotation is retained in the subclasses .class file in same named method/parameter
    for Java reflection use.
    This restores the behavior of Scala 2 for such RUNTIME annotated paramters.

    Closes ticket scala#22991
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

Successfully merging this pull request may close these issues.

Trait method parameter annotated with RetentionPolicy.RUNTIME annotation is not indicated in .class file for the method parameter

2 participants