@@ -1166,7 +1166,7 @@ trait Implicits { self: Typer =>
1166
1166
* search history (`root`) which in turn maintains a possibly empty dictionary of
1167
1167
* recursive implicit terms constructed during this search.
1168
1168
*
1169
- * A search history provides operations to created a nested search history, check for
1169
+ * A search history provides operations to create a nested search history, check for
1170
1170
* divergence, enter by name references and definitions in the implicit dictionary, lookup
1171
1171
* recursive references and emit a complete implicit dictionary when the outermost search
1172
1172
* is complete.
@@ -1220,22 +1220,20 @@ abstract class SearchHistory { outer =>
1220
1220
// as we ascend the chain of open implicits to the outermost search context.
1221
1221
1222
1222
@ tailrec
1223
- def loop (ois : List [(Candidate , Type )], belowByname : Boolean ): Boolean = {
1223
+ def loop (ois : List [(Candidate , Type )], belowByname : Boolean ): Boolean =
1224
1224
ois match {
1225
1225
case Nil => false
1226
1226
case (hd@ (cand1, tp)) :: tl =>
1227
- ( if (cand1.ref == cand.ref) {
1227
+ if (cand1.ref == cand.ref) {
1228
1228
val wideTp = tp.widenExpr
1229
1229
lazy val wildTp = wildApprox(wideTp)
1230
- if (belowByname && (wildTp <:< wildPt)) Some (false )
1231
- else if ((wideTp.typeSize < ptSize && wideTp.coveringSet == ptCoveringSet) || (wildTp == wildPt)) Some (true )
1232
- else None
1233
- } else None ) match {
1234
- case Some (res) => res
1235
- case None => loop(tl, isByname(tp) || belowByname)
1230
+ if (belowByname && (wildTp <:< wildPt)) false
1231
+ else if ((wideTp.typeSize < ptSize && wideTp.coveringSet == ptCoveringSet) || (wildTp == wildPt)) true
1232
+ else loop(tl, isByname(tp) || belowByname)
1236
1233
}
1234
+ else loop(tl, isByname(tp) || belowByname)
1237
1235
}
1238
- }
1236
+
1239
1237
loop(open, isByname(pt))
1240
1238
}
1241
1239
@@ -1378,7 +1376,7 @@ final class SearchRoot extends SearchHistory {
1378
1376
else {
1379
1377
result match {
1380
1378
case failure : SearchFailure => failure
1381
- case success@ SearchSuccess (tree, _, _) =>
1379
+ case success @ SearchSuccess (tree, _, _) =>
1382
1380
import tpd ._
1383
1381
1384
1382
// We might have accumulated dictionary entries for by name implicit arguments
@@ -1438,7 +1436,7 @@ final class SearchRoot extends SearchHistory {
1438
1436
tpd.ref(vsymMap(id.symbol))
1439
1437
case tree => tree
1440
1438
})
1441
- val nrhss = rhss.map(rhs => rhsMap(rhs ))
1439
+ val nrhss = rhss.map(rhsMap(_ ))
1442
1440
1443
1441
val vdefs = (nsyms zip nrhss) map {
1444
1442
case (nsym, nrhs) => ValDef (nsym.asTerm, nrhs)
0 commit comments