Skip to content
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

Fix attaching generic annotations #9234

Merged
merged 2 commits into from
Mar 1, 2024
Merged

Conversation

4e6
Copy link
Contributor

@4e6 4e6 commented Mar 1, 2024

Pull Request Description

Fixes the issue with attaching generic annotations in complex types.

Annotations in the type body could be lost during the compilation if its constructor was defined at the end of the type definition.

Important Notes

Checklist

Please ensure that the following checklist has been satisfied before submitting the PR:

  • The documentation has been updated, if necessary.
  • All code follows the
    Scala,
    Java,
    and
    Rust
    style guides. In case you are using a language not listed above, follow the Rust style guide.
  • All code has been tested:
    • Unit tests have been written where possible.
    • If GUI codebase was changed, the GUI was tested when built using ./run ide build.

@4e6 4e6 added the CI: No changelog needed Do not require a changelog entry for this PR. label Mar 1, 2024
@4e6 4e6 self-assigned this Mar 1, 2024
Copy link
Member

@JaroslavTulach JaroslavTulach left a comment

Choose a reason for hiding this comment

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

I can confirm that @jdunkerley's example seems to be fixed by your fix, @4e6. Thank you Dmitry.

@@ -125,6 +125,7 @@ case object ComplexType extends IRPass {
lastAnnotations = Seq()
res
case _ =>
lastAnnotations = Seq()
Copy link
Member

Choose a reason for hiding this comment

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

Unexpected place of fix - I was searching for the problem in GenericAnnotations...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The annotation was lost here in the ComplexType compiler phase, and later GenericAnnotations was processing IR without the annotation node.

@4e6 4e6 added the CI: Ready to merge This PR is eligible for automatic merge label Mar 1, 2024
@mergify mergify bot merged commit fad1b45 into develop Mar 1, 2024
25 of 28 checks passed
@mergify mergify bot deleted the wip/db/fix-attaching-annotations branch March 1, 2024 18:01
@enso-bot enso-bot bot mentioned this pull request Mar 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI: No changelog needed Do not require a changelog entry for this PR. CI: Ready to merge This PR is eligible for automatic merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants