Skip to content

Conversation

@nicolasstucki
Copy link
Contributor

@nicolasstucki nicolasstucki commented Nov 17, 2022

Fixes #15917
Fixes #16355

tryHeal(prefix.symbol, tp, pos)
case _ =>
mapOver(tp)
case tp @ TermRef(NoPrefix, _) if !tp.symbol.isStatic && level > levelOf(tp.symbol) =>
Copy link
Member

Choose a reason for hiding this comment

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

why do we check level > here but level != in healTypeOfTerm?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In healTypeOfTerm we are looking for terms that are used in other stages. Terms must be used at the same stage they are defined, hence the level !=.

For types the rules are a bit different. For types in general it is always safe to use the type in a previous stage and one needs a type Type[T] for generic types if it is used in a future stage. This is in general where the > comes in for type. But in this particular case, we have a type reference to a local variable that will not exist in the next stage and we cannot create a valid Type[T] for it. Therefore it emmits an error.

Copy link
Member

Choose a reason for hiding this comment

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

Thanks for the explanation, I think it'd be helpful to add something like that as a comment in the code

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added to the comment.

@nicolasstucki nicolasstucki requested a review from smarter December 2, 2022 13:30
Copy link
Member

@smarter smarter left a comment

Choose a reason for hiding this comment

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

A more detailed comment would be helpful, otherwise LGTM.

@smarter smarter assigned nicolasstucki and unassigned smarter Jan 3, 2023
@Kordyjan Kordyjan added this to the 3.3.1-RC1 milestone Jan 16, 2023
Copy link
Member

@smarter smarter left a comment

Choose a reason for hiding this comment

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

Otherwise LGTM.

@smarter smarter assigned nicolasstucki and unassigned smarter Jan 23, 2023
Co-authored-by: Guillaume Martres <smarter@ubuntu.com>
@nicolasstucki nicolasstucki merged commit eeb00d4 into scala:main Jan 23, 2023
@nicolasstucki nicolasstucki deleted the fix-16355 branch January 23, 2023 21:29
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.

assertion failed: unresolved symbols: parameter v when pickling Crash using variable type in macro expression

3 participants