diff options
Diffstat (limited to 'compiler/src/dotty/tools/dotc/transform/ExtensionMethods.scala')
-rw-r--r-- | compiler/src/dotty/tools/dotc/transform/ExtensionMethods.scala | 9 |
1 files changed, 7 insertions, 2 deletions
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)) + } } } |