From 2ccbfa57783270049105b8c171d69159d54e578c Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Mon, 26 Aug 2013 20:06:25 +0200 Subject: SI-7783 Don't issue deprecation warnings for inferred TypeTrees Deprecation checks in RefChecks were looking into all TypeTrees to find references to deprecated type aliases. However, when the compiler infers a type argument or type of a member it creates a TypeTree (with a null original) that was also leading to warnings. I ran into this problem often when upgrading a build from SBT 0.12 to 0.13: a plugin I was using used the deprecated type alias, and I suffered transitively when I used methods from its API. This commit disables the checks for inferred TypeTree-s. --- src/compiler/scala/tools/nsc/typechecker/RefChecks.scala | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/compiler/scala/tools/nsc/typechecker/RefChecks.scala') diff --git a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala index 83afb3a728..081f7a8696 100644 --- a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala +++ b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala @@ -1515,7 +1515,11 @@ abstract class RefChecks extends InfoTransform with scala.reflect.internal.trans private def checkTypeRef(tp: Type, tree: Tree, skipBounds: Boolean) = tp match { case TypeRef(pre, sym, args) => - checkDeprecated(sym, tree.pos) + tree match { + case tt: TypeTree if tt.original == null => // SI-7783 don't warn about inferred types + case _ => + checkDeprecated(sym, tree.pos) + } if(sym.isJavaDefined) sym.typeParams foreach (_.cookJavaRawInfo()) if (!tp.isHigherKinded && !skipBounds) -- cgit v1.2.3