Also map types in Implicits.emitDictionary#26143
Open
eejbyfeldt wants to merge 1 commit into
Open
Conversation
odersky
requested changes
May 30, 2026
| tpd.ref(vsymMap(id.symbol))(using ctx.withSource(id.source)).withSpan(id.span) | ||
| case tree => tree | ||
| }) | ||
| val rhsMap = new TreeTypeMap( |
Contributor
There was a problem hiding this comment.
The logic is fine, but I think we can remove duplication. Make a specialized TreeTypeMap class that's parameterized by two functions TermRef => Type and Ident => Term that implement the relevant cases for Termrefs/Idents that are vsymMap keys.
Contributor
Author
There was a problem hiding this comment.
Great suggestion! Updated the PR with a new helper.
Fixes: scala#20448 Before the test case would crash with ``` Exception in thread "main" java.lang.AssertionError: assertion failed: unresolved symbols: value $_lazy_implicit_$1 (line -1) scala#15419 when pickling /home/eejbyfeldt/dev/eejbyfeldt/scala_playground/scala3_crash.scala at scala.runtime.Scala3RunTime$.assertFailed(Scala3RunTime.scala:8) at dotty.tools.dotc.core.tasty.TreePickler.pickle(TreePickler.scala:872) at dotty.tools.dotc.transform.Pickler.run$$anonfun$1$$anonfun$1(Pickler.scala:136) ``` Because if there were path dependent types the types would not be updated and still refer to the old symbols.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes: #20448
Before the test case would crash with
Because if there were path dependent types the types would not be
updated and still refer to the old symbols.
How much have you relied on LLM-based tools in this contribution?
Extensively, for finding the location in code and writing the fix.
How was the solution tested?
New automated tests (including the issue's reproducer, if applicable)