diff options
author | Martin Odersky <odersky@gmail.com> | 2016-03-14 10:02:16 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2016-03-14 10:02:16 +0100 |
commit | 6c18e37886e90d217579112ccf867c22658273be (patch) | |
tree | 3e5bed6a8bee401d38c80d2b4fbdbfdd6cec039f /src/dotty/tools/dotc/typer/VarianceChecker.scala | |
parent | 13e3d59937ddcb9819904593cb7c6417af8eedd2 (diff) | |
download | dotty-6c18e37886e90d217579112ccf867c22658273be.tar.gz dotty-6c18e37886e90d217579112ccf867c22658273be.tar.bz2 dotty-6c18e37886e90d217579112ccf867c22658273be.zip |
Address reviewer comments.
Diffstat (limited to 'src/dotty/tools/dotc/typer/VarianceChecker.scala')
-rw-r--r-- | src/dotty/tools/dotc/typer/VarianceChecker.scala | 4 |
1 files changed, 2 insertions, 2 deletions
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 => |