diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2014-09-04 11:41:35 +1000 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2014-09-04 11:41:35 +1000 |
commit | a66f5df2bc7b56814bbd6f767a5bea198588d863 (patch) | |
tree | 5b2a046d4ee60ef6b83d6f7f64e4d9af8409723a /src/compiler | |
parent | 266c2105d974ed423a8c6664fbba62553c51626d (diff) | |
parent | 984025b2bd15b343181aea9c00a50ac1cd721ca1 (diff) | |
download | scala-a66f5df2bc7b56814bbd6f767a5bea198588d863.tar.gz scala-a66f5df2bc7b56814bbd6f767a5bea198588d863.tar.bz2 scala-a66f5df2bc7b56814bbd6f767a5bea198588d863.zip |
Merge pull request #3932 from gourlaysama/wip/t8498
SI-8498 @compileTimeOnly should be aware of bridge methods.
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/RefChecks.scala | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala index 1cb775959d..af4e9e8927 100644 --- a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala +++ b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala @@ -1287,6 +1287,7 @@ abstract class RefChecks extends InfoTransform with scala.reflect.internal.trans private def checkUndesiredProperties(sym: Symbol, pos: Position) { // If symbol is deprecated, and the point of reference is not enclosed // in either a deprecated member or a scala bridge method, issue a warning. + // TODO: x.hasBridgeAnnotation doesn't seem to be needed here... if (sym.isDeprecated && !currentOwner.ownerChain.exists(x => x.isDeprecated || x.hasBridgeAnnotation)) currentRun.reporting.deprecationWarning(pos, sym) @@ -1305,7 +1306,7 @@ abstract class RefChecks extends InfoTransform with scala.reflect.internal.trans reporter.warning(pos, s"${sym.fullLocationString} has changed semantics in version ${sym.migrationVersion.get}:\n${sym.migrationMessage.get}") } // See an explanation of compileTimeOnly in its scaladoc at scala.annotation.compileTimeOnly. - if (sym.isCompileTimeOnly) { + if (sym.isCompileTimeOnly && !currentOwner.ownerChain.exists(x => x.isCompileTimeOnly)) { def defaultMsg = sm"""Reference to ${sym.fullLocationString} should not have survived past type checking, |it should have been processed and eliminated during expansion of an enclosing macro.""" |