-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
add child to parent in completion context #21214
Conversation
1884: 293 .. 293 | ||
|
||
source paths: | ||
0: 27 [<elided source file name>] |
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.
the magic is that if you revert the change to Namer, then this will have three source paths - because the positions of the child annotations will be set in the context of A.scala
- i.e. the call site that forces the completion
This ensures that the positions of forced Child annotations always happens in the source file of the parent class, and not in another file that forced the completion to happen
06bd788
to
a2bec5e
Compare
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 tested this PR with my reproducer at https://codeberg.org/raboof/scala3-reproduce-21154 (invoking scalac directly, no sbt), and it appears to have the intended effect: no more references to FcmJsonSupport.scala
in FcmOption.tasty
, and also the previously-nondeterministic 'positions' entries are gone.
unfortunately it seems changing the classpath means representation of TASTy is not stable (but is semantically equivalent) i.e. some SHAREDtype might be replaced by equivalent types. This breaks the tastycheck test in #21214 with scala 2 library tasty. By changing to ordinary classes instead of enum cases, we limit generated code and avoid these specific examples of instability in the test. Manually, I confirmed that reverting the change to namer in #21214 still breaks the new test [test_scala2_library_tasty]
Backports #21214 to the 3.5.2 branch. PR submitted by the release tooling. [skip ci]
Backports #21214 to the 3.3.5. PR submitted by the release tooling. [skip ci]
This ensures that the positions of forced Child annotations always happens in the source file of the parent class, and not in another file that forced the completion to happen
fixes #21154