diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2015-09-08 12:55:01 +1000 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2015-09-08 12:55:01 +1000 |
commit | 77a728eddc21d7d47828dab03d03afeafc081a81 (patch) | |
tree | 2b2456888150b5d188981fc440a791111cab493d /src/compiler/scala/tools/nsc/typechecker/RefChecks.scala | |
parent | 5af7f23c63ea13b5132abeb2abaff8b44f5f5f2a (diff) | |
parent | 5bd8ea0edffe7b725e5fa665a82a5795d5dafe8f (diff) | |
download | scala-77a728eddc21d7d47828dab03d03afeafc081a81.tar.gz scala-77a728eddc21d7d47828dab03d03afeafc081a81.tar.bz2 scala-77a728eddc21d7d47828dab03d03afeafc081a81.zip |
Merge pull request #4673 from puffnfresh/issue/6806
SI-6806 Add an @implicitAmbiguous annotation
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/RefChecks.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/RefChecks.scala | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala index 90ac1f466d..c14b0e7a25 100644 --- a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala +++ b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala @@ -1468,10 +1468,13 @@ abstract class RefChecks extends InfoTransform with scala.reflect.internal.trans case m: MemberDef => val sym = m.symbol applyChecks(sym.annotations) - // validate implicitNotFoundMessage - analyzer.ImplicitNotFoundMsg.check(sym) foreach { warn => - reporter.warning(tree.pos, f"Invalid implicitNotFound message for ${sym}%s${sym.locationString}%s:%n$warn") - } + + def messageWarning(name: String)(warn: String) = + reporter.warning(tree.pos, f"Invalid $name message for ${sym}%s${sym.locationString}%s:%n$warn") + + // validate implicitNotFoundMessage and implicitAmbiguousMessage + analyzer.ImplicitNotFoundMsg.check(sym) foreach messageWarning("implicitNotFound") + analyzer.ImplicitAmbiguousMsg.check(sym) foreach messageWarning("implicitAmbiguous") case tpt@TypeTree() => if(tpt.original != null) { |