Skip to content

Fix: Copy annotations in Crystal::Def#expand_default_arguments#16007

Merged
straight-shoota merged 1 commit intocrystal-lang:masterfrom
ysbaddaden:fix/crystal-def-expand-default-arguments-doesnt-copy-annotations
Jul 22, 2025
Merged

Fix: Copy annotations in Crystal::Def#expand_default_arguments#16007
straight-shoota merged 1 commit intocrystal-lang:masterfrom
ysbaddaden:fix/crystal-def-expand-default-arguments-doesnt-copy-annotations

Conversation

@ysbaddaden
Copy link
Collaborator

@ysbaddaden ysbaddaden commented Jul 21, 2025

I'm not sure this should be considered a bug, we just never had any use from annotations on expanded def args before.

Extracted from #15999.

@ysbaddaden ysbaddaden self-assigned this Jul 21, 2025
@straight-shoota straight-shoota changed the title Fix: Crystal::Def#expand_default_arguments doesn't copy arg annotations Fix: Copy annotation sin Crystal::Def#expand_default_arguments Jul 21, 2025
@straight-shoota straight-shoota added the kind:bug A bug in the code. Does not apply to documentation, specs, etc. label Jul 21, 2025
@straight-shoota straight-shoota added this to the 1.18.0 milestone Jul 21, 2025
Copy link

@mverzilli mverzilli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

~200 lines, one function 😮‍💨 . Looks good, but don't we need a couple of new specs for this?

@straight-shoota
Copy link
Member

Except for the actual setter calls, this is just a refactor and the code should be covered by existing specs. We could add individual spec cases that ensure annotations are duplicated, but that feels a bit too detailed. We'll have that covered by feature specs for deprecated parameters in #15999

@straight-shoota straight-shoota changed the title Fix: Copy annotation sin Crystal::Def#expand_default_arguments Fix: Copy annotations in Crystal::Def#expand_default_arguments Jul 21, 2025
@straight-shoota straight-shoota merged commit acd2285 into crystal-lang:master Jul 22, 2025
40 checks passed
@ysbaddaden ysbaddaden deleted the fix/crystal-def-expand-default-arguments-doesnt-copy-annotations branch July 23, 2025 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:compiler:semantic

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants