forked from scala/scala3
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make sure definition tree has the defined symbol
It turns out it could have the wrong symbol referring to a same-named definition in the superclass under some recursive definition of a self type. This caused a crash in pickler in scala#21755 because we now have two different definitions in two different classes that have the same symbol. Fixes scala#21755
- Loading branch information
1 parent
aa38c33
commit 28e1bc0
Showing
4 changed files
with
34 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -999,6 +999,7 @@ class TreeUnpickler(reader: TastyReader, | |
} | ||
} | ||
|
||
tree.ensureHasSym(sym) | ||
tree.setDefTree | ||
} | ||
|
||
|
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
trait GraphTraversal { | ||
type NodeT | ||
|
||
protected trait Properties { | ||
def root: NodeT | ||
} | ||
|
||
abstract protected class TraverserMethods[A, +CC <: TraverserMethods[A, CC]] { this: CC with Properties => | ||
def root: NodeT | ||
} | ||
} |