aboutsummaryrefslogtreecommitdiff
path: root/compiler/src/dotty/tools/dotc/transform
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/src/dotty/tools/dotc/transform')
-rw-r--r--compiler/src/dotty/tools/dotc/transform/ElimByName.scala6
-rw-r--r--compiler/src/dotty/tools/dotc/transform/ExtensionMethods.scala9
2 files changed, 12 insertions, 3 deletions
diff --git a/compiler/src/dotty/tools/dotc/transform/ElimByName.scala b/compiler/src/dotty/tools/dotc/transform/ElimByName.scala
index 2814baf1e..0e187fc2e 100644
--- a/compiler/src/dotty/tools/dotc/transform/ElimByName.scala
+++ b/compiler/src/dotty/tools/dotc/transform/ElimByName.scala
@@ -81,7 +81,11 @@ class ElimByName extends MiniPhaseTransform with InfoTransformer { thisTransform
val inSuper = if (ctx.mode.is(Mode.InSuperCall)) InSuperCall else EmptyFlags
val meth = ctx.newSymbol(
ctx.owner, nme.ANON_FUN, Synthetic | Method | inSuper, MethodType(Nil, Nil, argType))
- Closure(meth, _ => arg.changeOwner(ctx.owner, meth))
+ Closure(meth, _ =>
+ atGroupEnd { implicit ctx: Context =>
+ arg.changeOwner(ctx.owner, meth)
+ }
+ )
}
ref(defn.dummyApply).appliedToType(argType).appliedTo(argFun)
case _ =>
diff --git a/compiler/src/dotty/tools/dotc/transform/ExtensionMethods.scala b/compiler/src/dotty/tools/dotc/transform/ExtensionMethods.scala
index 925ec08b2..64474cecd 100644
--- a/compiler/src/dotty/tools/dotc/transform/ExtensionMethods.scala
+++ b/compiler/src/dotty/tools/dotc/transform/ExtensionMethods.scala
@@ -63,8 +63,13 @@ class ExtensionMethods extends MiniPhaseTransform with DenotTransformer with Ful
// not generate them again.
if (!(valueClass is Scala2x)) ctx.atPhase(thisTransformer) { implicit ctx =>
for (decl <- valueClass.classInfo.decls) {
- if (isMethodWithExtension(decl))
- decls1.enter(createExtensionMethod(decl, moduleClassSym.symbol))
+ if (isMethodWithExtension(decl)) {
+ val meth = createExtensionMethod(decl, moduleClassSym.symbol)
+ decls1.enter(meth)
+ // Workaround #1895: force denotation of `meth` to be
+ // at phase where `meth` is entered into the decls of a class
+ meth.denot(ctx.withPhase(thisTransformer.next))
+ }
}
}