You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -994,11 +994,13 @@ abstract class RefChecks extends Transform {
994
994
defapply(tp: Type) = mapOver(tp).normalize
995
995
}
996
996
997
-
defcheckImplicitViewOptionApply(pos: Position, fun: Tree, argss: List[List[Tree]]):Unit=if (settings.warnOptionImplicit) argss match {
998
-
caseList(List(view: ApplyImplicitView)) if fun.symbol == currentRun.runDefinitions.Option_apply=>
999
-
refchecksWarning(pos, s"Suspicious application of an implicit view (${view.fun}) in the argument to Option.apply.", WarningCategory.LintOptionImplicit) // scala/bug#6567
if (settings.warnOptionImplicit && fun.symbol == currentRun.runDefinitions.Option_apply)
999
+
argss match {
1000
+
case (((view @Apply(coercion, _)) ::Nil) ::Nil) if view.hasAttachment[AppliedImplicitView.type] =>
1001
+
refchecksWarning(pos, s"Suspicious application of an implicit view ($coercion) in the argument to Option.apply.", LintOptionImplicit) // scala/bug#6567
1002
+
case _ =>
1003
+
}
1002
1004
1003
1005
privatedefisObjectOrAnyComparisonMethod(sym: Symbol) = sym match {
caseApply(coercion, _) if t.isInstanceOf[ApplyImplicitView] =>
2079
+
caseApply(coercion, _) if t.hasAttachment[AppliedImplicitView.type] =>
2078
2080
coercion.symbol.paramLists match {
2079
2081
case (p ::Nil) :: _ if p.isByNameParam => refchecksWarning(t.pos, s"Block result expression was adapted via implicit conversion (${coercion.symbol}) taking a by-name parameter; only the result was passed, not the entire block.", WarningCategory.LintBynameImplicit)
// don't try to adapt a top-level type that's the subject of an implicit search
@@ -1410,7 +1410,7 @@ trait Typers extends Adaptations with Tags with TypersTracking with PatternTyper
1410
1410
if (currentRun.isScala3 && coercion.symbol == currentRun.runDefinitions.Predef_any2stringaddMethod)
1411
1411
if (!currentRun.sourceFeatures.any2StringAdd)
1412
1412
runReporting.warning(qual.pos, s"Converting to String for concatenation is not supported in Scala 3 (or with -Xsource-features:any2stringadd).", Scala3Migration, coercion.symbol)
0 commit comments