Skip to content

Commit 3d1ab81

Browse files
committed
Enable new implementation by default
With an opt-out system property
1 parent 21b585d commit 3d1ab81

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/compiler/scala/tools/nsc/typechecker/Implicits.scala

+4-3
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ trait Implicits {
181181
private val infoMapCache = new LinkedHashMap[Symbol, InfoMap]
182182
private val improvesCache = perRunCaches.newMap[(ImplicitInfo, ImplicitInfo), Boolean]()
183183
private val implicitSearchId = { var id = 1 ; () => try id finally id += 1 }
184-
184+
private val shadowerUseOldImplementation = java.lang.Boolean.getBoolean("scalac.implicit.shadow.old")
185185
def resetImplicits() {
186186
implicitsCache.clear()
187187
infoMapCache.clear()
@@ -986,7 +986,7 @@ trait Implicits {
986986

987987
/** Sorted list of eligible implicits.
988988
*/
989-
val eligible = Shadower.using(isLocalToCallsite){ shadower =>
989+
private def eligibleOld = Shadower.using(isLocalToCallsite){ shadower =>
990990
val matches = iss flatMap { is =>
991991
val result = is filter (info => checkValid(info.sym) && survives(info, shadower))
992992
shadower addInfos is
@@ -1070,9 +1070,10 @@ trait Implicits {
10701070
}
10711071
}
10721072

1073+
val eligible = if (shadowerUseOldImplementation) eligibleOld else eligibleNew
1074+
10731075
if (eligible.nonEmpty)
10741076
printTyping(tree, eligible.size + s" eligible for pt=$pt at ${fullSiteString(context)}")
1075-
assert(eligibleNew == eligible, (eligibleNew, eligible))
10761077

10771078
/** Faster implicit search. Overall idea:
10781079
* - prune aggressively

0 commit comments

Comments
 (0)