diff options
author | Adriaan Moors <adriaan.moors@typesafe.com> | 2014-06-10 12:32:06 +0200 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2014-07-04 15:49:07 +0200 |
commit | e08735380e8cba8f4b7230f5615e528782a0111a (patch) | |
tree | c1719135c315a32db4f921aebbb6d6e0f56eb0a8 /src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala | |
parent | 62c8f90f3105b8f19a9f29f104ff232438372c73 (diff) | |
download | scala-e08735380e8cba8f4b7230f5615e528782a0111a.tar.gz scala-e08735380e8cba8f4b7230f5615e528782a0111a.tar.bz2 scala-e08735380e8cba8f4b7230f5615e528782a0111a.zip |
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?)
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala | 4 |
1 files changed, 2 insertions, 2 deletions
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 }) |