You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Revert "Fix callTrace if inlined methods" (#19273)
This reverts commit ec75826.
The previous encoding of INLINE nodes in TASTy assumed that the
callTrace was a type. We cannot make it a term, or we would not be able
to unpickle this tree properly. We need another solution to be able to
pickle this correctly. For now we revert the change to avoid generating
invalid TASTy.
Copy file name to clipboardExpand all lines: compiler/src/dotty/tools/dotc/inlines/Inlines.scala
+14
Original file line number
Diff line number
Diff line change
@@ -299,6 +299,20 @@ object Inlines:
299
299
(newReposition).transform(tree)
300
300
endreposition
301
301
302
+
/** Leave only a call trace consisting of
303
+
* - a reference to the top-level class from which the call was inlined,
304
+
* - the call's position
305
+
* in the call field of an Inlined node.
306
+
* The trace has enough info to completely reconstruct positions.
307
+
* Note: For macros it returns a Select and for other inline methods it returns an Ident (this distinction is only temporary to be able to run YCheckPositions)
Copy file name to clipboardExpand all lines: compiler/src/dotty/tools/dotc/transform/YCheckPositions.scala
+13-6
Original file line number
Diff line number
Diff line change
@@ -46,8 +46,10 @@ class YCheckPositions extends Phase {
46
46
sources = old
47
47
case tree @Inlined(call, bindings, expansion) =>
48
48
// bindings.foreach(traverse(_)) // TODO check inline proxies (see tests/tun/lst)
49
-
sources = call.symbol.source :: sources
50
-
if (!isMacro(call)) // FIXME macro implementations can drop Inlined nodes. We should reinsert them after macro expansion based on the positions of the trees
if!isMacro(call) // FIXME macro implementations can drop Inlined nodes. We should reinsert them after macro expansion based on the positions of the trees
51
+
&&!isBootstrappedPredefWithPatchedMethods(call) // FIXME The patched symbol has a different source as the definition of Predef. Solution: define them directly in `Predef`s TASTy and do not patch (see #19231).
0 commit comments