summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/TypeDiagnostics.scala3
-rw-r--r--test/files/pos/t8040.scala2
2 files changed, 4 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/TypeDiagnostics.scala b/src/compiler/scala/tools/nsc/typechecker/TypeDiagnostics.scala
index fa0407792e..7013c7da93 100644
--- a/src/compiler/scala/tools/nsc/typechecker/TypeDiagnostics.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/TypeDiagnostics.scala
@@ -657,7 +657,8 @@ trait TypeDiagnostics {
opc.iterator.exists(pair => pair.low == m)
}
def isConvention(p: Symbol): Boolean = {
- p.name.decoded == "args" && p.owner.name.decoded == "main"
+ (p.name.decoded == "args" && p.owner.isMethod && p.owner.name.decoded == "main") ||
+ (p.tpe =:= typeOf[scala.Predef.DummyImplicit])
}
def warnable(s: Symbol) = (
(settings.warnUnusedParams || s.isImplicit)
diff --git a/test/files/pos/t8040.scala b/test/files/pos/t8040.scala
index b067f36b0b..1d1a770060 100644
--- a/test/files/pos/t8040.scala
+++ b/test/files/pos/t8040.scala
@@ -3,4 +3,6 @@ object Test {
implicit class C(val sc: StringContext) { // no warn unused sc
def c(args: Any*): String = "c?" + args.mkString(",") // would warn unused args
}
+
+ def f(implicit x: DummyImplicit) = 42 // no warn DummyImplicit
}