aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/typer
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2016-03-14 10:02:16 +0100
committerMartin Odersky <odersky@gmail.com>2016-03-14 10:02:16 +0100
commit6c18e37886e90d217579112ccf867c22658273be (patch)
tree3e5bed6a8bee401d38c80d2b4fbdbfdd6cec039f /src/dotty/tools/dotc/typer
parent13e3d59937ddcb9819904593cb7c6417af8eedd2 (diff)
downloaddotty-6c18e37886e90d217579112ccf867c22658273be.tar.gz
dotty-6c18e37886e90d217579112ccf867c22658273be.tar.bz2
dotty-6c18e37886e90d217579112ccf867c22658273be.zip
Address reviewer comments.
Diffstat (limited to 'src/dotty/tools/dotc/typer')
-rw-r--r--src/dotty/tools/dotc/typer/Typer.scala6
-rw-r--r--src/dotty/tools/dotc/typer/VarianceChecker.scala4
2 files changed, 5 insertions, 5 deletions
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)
diff --git a/src/dotty/tools/dotc/typer/VarianceChecker.scala b/src/dotty/tools/dotc/typer/VarianceChecker.scala
index 1769835da..274218ee3 100644
--- a/src/dotty/tools/dotc/typer/VarianceChecker.scala
+++ b/src/dotty/tools/dotc/typer/VarianceChecker.scala
@@ -114,8 +114,8 @@ class VarianceChecker()(implicit ctx: Context) {
case Some(VarianceError(tvar, required)) =>
def msg = i"${varianceString(tvar.flags)} $tvar occurs in ${varianceString(required)} position in type ${sym.info} of $sym"
if (ctx.scala2Mode && sym.owner.isConstructor) {
- ctx.migrationWarning(s"According to new variance rules, this is no longer accepted; need to annotate with @uncheckedVariance:\n$msg, pos = ${sym.pos}", sym.pos)
- patch(ctx.compilationUnit.source, Position(pos.end), " @scala.annotation.unchecked.uncheckedVariance") // TODO use an import or shorten if possible
+ ctx.migrationWarning(s"According to new variance rules, this is no longer accepted; need to annotate with @uncheckedVariance:\n$msg", sym.pos)
+ patch(Position(pos.end), " @scala.annotation.unchecked.uncheckedVariance") // TODO use an import or shorten if possible
}
else ctx.error(msg, sym.pos)
case None =>