Skip to content

Commit 42b3102

Browse files
committed
address review: part 3
1 parent be8d0c6 commit 42b3102

File tree

10 files changed

+6
-139
lines changed

10 files changed

+6
-139
lines changed

compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -170,13 +170,13 @@ class TreeUnpickler(reader: TastyReader,
170170
case ex: Exception => fail(ex)
171171
}
172172

173-
class TreeReader(val reader: TastyReader, inInlineBody: Boolean = false) {
173+
class TreeReader(val reader: TastyReader) {
174174
import reader.*
175175

176-
def forkAt(start: Addr, inInlineBody: Boolean = false): TreeReader =
177-
new TreeReader(subReader(start, endAddr), inInlineBody)
176+
def forkAt(start: Addr): TreeReader =
177+
new TreeReader(subReader(start, endAddr))
178178

179-
def fork: TreeReader = forkAt(currentAddr, inInlineBody)
179+
def fork: TreeReader = forkAt(currentAddr)
180180

181181
def skipParentTree(tag: Int): Unit = {
182182
if tag == SPLITCLAUSE then ()
@@ -696,7 +696,7 @@ class TreeUnpickler(reader: TastyReader,
696696
val ctx1 = localContext(sym)(using ctx0).addMode(Mode.ReadPositions)
697697
inContext(sourceChangeContext(Addr(0))(using ctx1)) {
698698
// avoids space leaks by not capturing the current context
699-
forkAt(rhsStart, inInlineBody = true).readTree()
699+
forkAt(rhsStart).readTree()
700700
}
701701
})
702702
goto(start)
@@ -1585,11 +1585,7 @@ class TreeUnpickler(reader: TastyReader,
15851585
val denot = inContext(ctx.addMode(Mode.ResolveFromTASTy)):
15861586
searchDenot // able to resolve Invisible members
15871587

1588-
1589-
val sel = makeSelect(qual, name, denot)
1590-
if denot == NoDenotation && inInlineBody && sel.denot.symbol.exists && sel.symbol.isDefinedInCurrentRun then
1591-
throw new ChangedMethodDenot(sel.denot.symbol)
1592-
sel
1588+
makeSelect(qual, name, denot)
15931589
case REPEATED =>
15941590
val elemtpt = readTpt()
15951591
SeqLiteral(until(end)(readTree()), elemtpt)
@@ -1896,9 +1892,6 @@ class TreeUnpickler(reader: TastyReader,
18961892

18971893
object TreeUnpickler {
18981894

1899-
/** Specifically thrown when a SELECTin was written to TASTy, i.e. is expected to resolve, and then doesn't. */
1900-
private[dotc] final class ChangedMethodDenot(val resolved: Symbol) extends Exception
1901-
19021895
/** Define the expected format of the tasty bytes
19031896
* - TopLevel: Tasty that contains a full class nested in its package
19041897
* - Term: Tasty that contains only a term tree

compiler/src/dotty/tools/dotc/inlines/Inlines.scala

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -161,16 +161,6 @@ object Inlines:
161161
try bodyToInline(tree.symbol) // can typecheck the tree and thereby produce errors
162162
catch
163163
case _: MissingInlineInfo => throw CyclicReference(ctx.owner)
164-
case err: TreeUnpickler.ChangedMethodDenot =>
165-
// tested in sbt-test/tasty-compat/add-param-unroll2/a_v3/A.scala
166-
if err.resolved.source == ctx.source then
167-
report.error(em"""cannot inline ${tree.symbol}:
168-
| The definition of ${err.resolved.showLocated}, defined in the current file, has changed incompatibly.
169-
| Try inlining from a different file.""", tree.srcPos)
170-
EmptyTree
171-
else
172-
// Tested in sbt-test/tasty-compat/add-param-unroll2/a_v3_2/C.scala
173-
ctx.compilationUnit.suspend("suspending in case of possible generated methods")
174164
new InlineCall(tree).expand(body)
175165
else
176166
ctx.base.stopInlining = true

sbt-test/tasty-compat/add-param-unroll2/a_v1/A.scala

Lines changed: 0 additions & 10 deletions
This file was deleted.

sbt-test/tasty-compat/add-param-unroll2/a_v2/B.scala

Lines changed: 0 additions & 8 deletions
This file was deleted.

sbt-test/tasty-compat/add-param-unroll2/a_v3/A.scala

Lines changed: 0 additions & 19 deletions
This file was deleted.

sbt-test/tasty-compat/add-param-unroll2/a_v3_2/A.scala

Lines changed: 0 additions & 10 deletions
This file was deleted.

sbt-test/tasty-compat/add-param-unroll2/a_v3_2/C.scala

Lines changed: 0 additions & 9 deletions
This file was deleted.

sbt-test/tasty-compat/add-param-unroll2/build.sbt

Lines changed: 0 additions & 38 deletions
This file was deleted.

sbt-test/tasty-compat/add-param-unroll2/project/DottyInjectedPlugin.scala

Lines changed: 0 additions & 11 deletions
This file was deleted.

sbt-test/tasty-compat/add-param-unroll2/test

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)