File tree 1 file changed +4
-3
lines changed
src/compiler/scala/tools/nsc/typechecker
1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -181,7 +181,7 @@ trait Implicits {
181
181
private val infoMapCache = new LinkedHashMap [Symbol , InfoMap ]
182
182
private val improvesCache = perRunCaches.newMap[(ImplicitInfo , ImplicitInfo ), Boolean ]()
183
183
private val implicitSearchId = { var id = 1 ; () => try id finally id += 1 }
184
-
184
+ private val shadowerUseOldImplementation = java.lang. Boolean .getBoolean( " scalac.implicit.shadow.old " )
185
185
def resetImplicits () {
186
186
implicitsCache.clear()
187
187
infoMapCache.clear()
@@ -986,7 +986,7 @@ trait Implicits {
986
986
987
987
/** Sorted list of eligible implicits.
988
988
*/
989
- val eligible = Shadower .using(isLocalToCallsite){ shadower =>
989
+ private def eligibleOld = Shadower .using(isLocalToCallsite){ shadower =>
990
990
val matches = iss flatMap { is =>
991
991
val result = is filter (info => checkValid(info.sym) && survives(info, shadower))
992
992
shadower addInfos is
@@ -1070,9 +1070,10 @@ trait Implicits {
1070
1070
}
1071
1071
}
1072
1072
1073
+ val eligible = if (shadowerUseOldImplementation) eligibleOld else eligibleNew
1074
+
1073
1075
if (eligible.nonEmpty)
1074
1076
printTyping(tree, eligible.size + s " eligible for pt= $pt at ${fullSiteString(context)}" )
1075
- assert(eligibleNew == eligible, (eligibleNew, eligible))
1076
1077
1077
1078
/** Faster implicit search. Overall idea:
1078
1079
* - prune aggressively
You can’t perform that action at this time.
0 commit comments