@@ -174,7 +174,7 @@ object Applications {
174174 def productArity : Int = app.productArity
175175 def productElement (n : Int ): Any = app.productElement(n)
176176 }
177-
177+
178178 /** The unapply method of this extractor also recognizes ExtMethodApplys in closure blocks.
179179 * This is necessary to deal with closures as left arguments of extension method applications.
180180 * A test case is i5606.scala
@@ -1511,14 +1511,14 @@ trait Applications extends Compatibility { self: Typer with Dynamic =>
15111511
15121512 case pt @ PolyProto (targs1, pt1) if targs.isEmpty =>
15131513 val alts1 = alts filter pt.isMatchedBy
1514- resolveOverloaded(alts1, pt1, targs1.tpes, pos )
1514+ resolveOverloaded(alts1, pt1, targs1.tpes)
15151515
15161516 case defn.FunctionOf (args, resultType, _, _) =>
15171517 narrowByTypes(alts, args, resultType)
15181518
15191519 case pt =>
1520- val noSam = alts filter (normalizedCompatible(_, pt))
1521- if (noSam .isEmpty) {
1520+ val compat = alts. filter(normalizedCompatible(_, pt))
1521+ if (compat .isEmpty)
15221522 /*
15231523 * the case should not be moved to the enclosing match
15241524 * since SAM type must be considered only if there are no candidates
@@ -1528,14 +1528,10 @@ trait Applications extends Compatibility { self: Typer with Dynamic =>
15281528 * new java.io.ObjectOutputStream(f)
15291529 */
15301530 pt match {
1531- case SAMType (mtp) =>
1532- val sam = narrowByTypes(alts, mtp.paramInfos, mtp.resultType)
1533- if (sam.nonEmpty && ! pt.classSymbol.hasAnnotation(defn.FunctionalInterfaceAnnot ))
1534- ctx.warning(ex " ${sam.head.designator} is eta-expanded even though $pt does not have the @FunctionalInterface annotation. " , pos)
1535- sam
1536- case _ => noSam
1531+ case SAMType (mtp) => narrowByTypes(alts, mtp.paramInfos, mtp.resultType)
1532+ case _ => compat
15371533 }
1538- } else noSam
1534+ else compat
15391535 }
15401536 val found = narrowMostSpecific(candidates)
15411537 if (found.length <= 1 ) found
@@ -1544,7 +1540,7 @@ trait Applications extends Compatibility { self: Typer with Dynamic =>
15441540 if (noDefaults.length == 1 ) noDefaults // return unique alternative without default parameters if it exists
15451541 else {
15461542 val deepPt = pt.deepenProto
1547- if (deepPt ne pt) resolveOverloaded(alts, deepPt, targs, pos )
1543+ if (deepPt ne pt) resolveOverloaded(alts, deepPt, targs)
15481544 else alts
15491545 }
15501546 }
0 commit comments