aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/dotty/tools/dotc/typer/Inliner.scala10
-rw-r--r--src/dotty/tools/dotc/typer/Typer.scala2
2 files changed, 7 insertions, 5 deletions
diff --git a/src/dotty/tools/dotc/typer/Inliner.scala b/src/dotty/tools/dotc/typer/Inliner.scala
index e865c0596..cd042c476 100644
--- a/src/dotty/tools/dotc/typer/Inliner.scala
+++ b/src/dotty/tools/dotc/typer/Inliner.scala
@@ -192,9 +192,11 @@ object Inliner {
/** The accessor defs to non-public members which need to be defined
* together with the inline method
*/
- def accessors(implicit ctx: Context): List[MemberDef] = {
+ def removeAccessors(implicit ctx: Context): List[MemberDef] = {
ensureEvaluated()
- myAccessors.toList
+ val res = myAccessors.toList
+ myAccessors.clear()
+ res
}
}
@@ -242,8 +244,8 @@ object Inliner {
* @pre hasBodyToInline(sym)
*/
- def inlineAccessors(sym: SymDenotation)(implicit ctx: Context): List[MemberDef] =
- inlineInfo(sym).get.accessors
+ def removeInlineAccessors(sym: SymDenotation)(implicit ctx: Context): List[MemberDef] =
+ inlineInfo(sym).get.removeAccessors
/** Try to inline a call to a `@inline` method. Fail with error if the maximal
* inline depth is exceeded.
diff --git a/src/dotty/tools/dotc/typer/Typer.scala b/src/dotty/tools/dotc/typer/Typer.scala
index d1a2ad5c2..dde2c866b 100644
--- a/src/dotty/tools/dotc/typer/Typer.scala
+++ b/src/dotty/tools/dotc/typer/Typer.scala
@@ -1498,7 +1498,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
val mdef1 = typed(mdef)
buf += mdef1
if (Inliner.hasBodyToInline(mdef1.symbol))
- buf ++= Inliner.inlineAccessors(mdef1.symbol)
+ buf ++= Inliner.removeInlineAccessors(mdef1.symbol)
traverse(rest)
}
case Thicket(stats) :: rest =>