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 mapping TypeMaps over annotations #15948

Merged
merged 2 commits into from
Sep 3, 2022
Merged

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Sep 1, 2022

Avoids orphan parameters when pickling

Fixes #15922

I am not sure about the status of the test in custome-args/captures. Should it
pass or be rejected? But in any case it does not crash anymore.

Avoids orphan parameters when pickling

Fixes scala#15922

I am not sure about the status of the test in custome-args/captures. Should it
pass or be rejected? But in any case it does not crash anymore.
@@ -58,7 +59,7 @@ object Annotations {
if tm.isRange(x) then x
else
val tp1 = tm(tree.tpe)
foldOver(if tp1 =:= tree.tpe then x else tp1, tree)
foldOver(if tp1 frozen_=:= tree.tpe then x else tp1, tree)
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 change that fixed the test case was this one.

Copy link
Contributor

@Linyxus Linyxus left a comment

Choose a reason for hiding this comment

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

LGTM! 👍

@Linyxus
Copy link
Contributor

Linyxus commented Sep 2, 2022

What is the test in custom-args/captures? I looked at the tests directory but can only find pos-custom-args/captures and neg-custom-args/captures.

@odersky
Copy link
Contributor Author

odersky commented Sep 2, 2022

I meant pos-customargs/captures

@@ -19,6 +19,7 @@ i6507b.scala
i12299a.scala
i13871.scala
i15181.scala
i15922.scala
Copy link
Member

Choose a reason for hiding this comment

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

How come?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did not have the time to follow up on this.

@Linyxus
Copy link
Contributor

Linyxus commented Sep 3, 2022

I meant pos-customargs/captures

Yes it should be accepted. Although it was taken from a negative example, it does not include the line of code that really should be rejected (the line that actually uses the boxed capability).

@Linyxus
Copy link
Contributor

Linyxus commented Sep 3, 2022

Maybe let's merge this PR first and open an issue to follow up the pickling failure of pos/i15922.scala.

@Linyxus Linyxus merged commit 37e624f into scala:main Sep 3, 2022
@Kordyjan Kordyjan added this to the 3.2.2 milestone Aug 1, 2023
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.

Orphan parameter reference in capture set
4 participants