-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix trait setter validity #12144
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 trait setter validity #12144
Conversation
@@ -146,6 +147,7 @@ class Mixin extends MiniPhase with SymTransformer { thisPhase => | |||
// !decl.isClass avoids forcing nested traits, preventing cycles | |||
if !decl.isClass && needsTraitSetter(decl) then | |||
val setter = makeTraitSetter(decl.asTerm) | |||
setter.validFor = Period(ctx.runId, thisPhase.next.id, decl.validFor.lastPhaseId) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can use thisPhase.validFor here, this is what we had to do in https://github.com/lampepfl/dotty/blob/0ca0b9ea27620089291eae7716590b749298533d/compiler/src/dotty/tools/dotc/transform/ExtensionMethods.scala#L66-L74
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no objection, but I can't really say that I understand why this really does or why it solves the issue.
Now I get: Unable to get Dotty latest nightly build version. Make sure you are connected to internet in CommunityBuildC, when trying to compile shapeless. Any ideas what this could be? |
Another PR of mine fails for the same reason, so it looks like a CI problem. |
not sure, but I see shapeless has been updated upstream to remove the call to dottyLatestNightly, @milessabin could you open a PR to update shapeless in our community build? |
Publishing 3.0.0-RC3 today made I believe this will fix itself after the next successful nightly build, but |
Trait setters had a validity interval that started before they were created. This caused stale symbol errors in macro compilations.
Trait setters had a validity interval that started before they were created.
This caused stale symbol errors in macro compilations.
Fixes #12140