From e08735380e8cba8f4b7230f5615e528782a0111a Mon Sep 17 00:00:00 2001 From: Adriaan Moors Date: Tue, 10 Jun 2014 12:32:06 +0200 Subject: Track symbol that caused a deprecation warning. So that we can filter deprecations based on defining package. Configurable error reporting will support a rule like: "In compilation unit X, escalate deprecation warnings that result from accessing members in package P that have been deprecated since version V. Report an error instead of a warning for those." TODO: remove deprecationWarning overload that doesn't take a `Symbol`? (Replace by a default value of `NoSymbol` for the deprecated symbol arg?) --- src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala') diff --git a/src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala b/src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala index 284ab2f6f9..65f33952d3 100644 --- a/src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala +++ b/src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala @@ -536,8 +536,8 @@ trait NamesDefaults { self: Analyzer => def matchesName(param: Symbol) = !param.isSynthetic && ( (param.name == name) || (param.deprecatedParamName match { case Some(`name`) => - context0.unit.deprecationWarning(arg.pos, - "the parameter name "+ name +" has been deprecated. Use "+ param.name +" instead.") + context0.unit.deprecationWarning(arg.pos, param, + s"the parameter name $name has been deprecated. Use ${param.name} instead.") true case _ => false }) -- cgit v1.2.3