From 6c18e37886e90d217579112ccf867c22658273be Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Mon, 14 Mar 2016 10:02:16 +0100 Subject: Address reviewer comments. --- src/dotty/tools/dotc/typer/Typer.scala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/dotty/tools/dotc/typer/Typer.scala') diff --git a/src/dotty/tools/dotc/typer/Typer.scala b/src/dotty/tools/dotc/typer/Typer.scala index 1a0525c6d..2069e790b 100644 --- a/src/dotty/tools/dotc/typer/Typer.scala +++ b/src/dotty/tools/dotc/typer/Typer.scala @@ -998,7 +998,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit if (sym.is(Lazy, butNot = Deferred | Module | Synthetic) && !sym.isVolatile && ctx.scala2Mode && ctx.settings.rewrite.value.isDefined && !ctx.isAfterTyper) - patch(ctx.compilationUnit.source, Position(toUntyped(vdef).envelope.start), "@volatile ") + patch(Position(toUntyped(vdef).envelope.start), "@volatile ") } def typedDefDef(ddef: untpd.DefDef, sym: Symbol)(implicit ctx: Context) = track("typedDefDef") { @@ -1158,8 +1158,8 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit if (ctx.scala2Mode) { // Under -rewrite, patch `x _` to `(() => x)` ctx.migrationWarning(msg, tree.pos) - patch(ctx.compilationUnit.source, Position(tree.pos.start), "(() => ") - patch(ctx.compilationUnit.source, Position(qual.pos.end, tree.pos.end), ")") + patch(Position(tree.pos.start), "(() => ") + patch(Position(qual.pos.end, tree.pos.end), ")") res = typed(untpd.Function(Nil, untpd.TypedSplice(res))) } else ctx.error(msg, tree.pos) -- cgit v1.2.3