aboutsummaryrefslogtreecommitdiff
path: root/compiler/src/dotty/tools/dotc/transform
diff options
context:
space:
mode:
authorGuillaume Martres <smarter@ubuntu.com>2017-01-28 20:38:36 +0100
committerGitHub <noreply@github.com>2017-01-28 20:38:36 +0100
commit6e8933ccc40bbfe1a92c32c2d8314fd6facef12a (patch)
treea2a741e5e1c19caaab034a46c940cbbbd1a74eef /compiler/src/dotty/tools/dotc/transform
parentd5201d3da5b6edb1abc61b51f125c0a3fd56000c (diff)
parentfc2f9314be7281e24e4ce7434f97cc42cb2f01d4 (diff)
downloaddotty-6e8933ccc40bbfe1a92c32c2d8314fd6facef12a.tar.gz
dotty-6e8933ccc40bbfe1a92c32c2d8314fd6facef12a.tar.bz2
dotty-6e8933ccc40bbfe1a92c32c2d8314fd6facef12a.zip
Merge pull request #1896 from dotty-staging/fix/bootstrap
Add sbt-based bootstrap
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))
+ }
}
}