Open
Description
Current state
- Trees encode their source in
uniqueId
. This encoding is fragile and may have caused some issues (see dotc: Error: requirement failed: array index too large, maximum is 2^30 - 1 #9738). Inlined
tree- When typing contains the original call in
call
- After
PostTyper
we encode a reference to the top-level class of the inlined code incall
. This contains a symbol from which we get the source.
- When typing contains the original call in
Improvements
The idea is to only keep the source in each tree in a clean way.
- Add a source field in
Tree
- Is the overhead acceptable? Or find better encoding. (see Make source a field in Positioned nodes #9900)
- Drop Inline nodes in
PostTyper
- Use tree sources to reposition for JSR-45 workaround (see Inliner.scala#L222 , Improve debugging support by implementing JSR-45 #9715, Reposition trees in erasure using source from tree #9954)
- Pickle/unpickle tree sources in TASTy
- Remove or repurpose YCheckPositions
- TASTy Reflect
- Reinterpret
Inlined
asBlock
s - Allow access to tree sources
- Reinterpret