Skip to content

Commit 23aac97

Browse files
committed
Enable new implementation by default
With an opt-out system property
1 parent ddaaf41 commit 23aac97

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

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

Lines changed: 4 additions & 3 deletions
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
@@ -1053,9 +1053,10 @@ trait Implicits {
10531053
}
10541054
}
10551055

1056+
val eligible = if (shadowerUseOldImplementation) eligibleOld else eligibleNew
1057+
10561058
if (eligible.nonEmpty)
10571059
printTyping(tree, eligible.size + s" eligible for pt=$pt at ${fullSiteString(context)}")
1058-
assert(eligibleNew == eligible, (eligibleNew, eligible))
10591060

10601061
/** Faster implicit search. Overall idea:
10611062
* - prune aggressively

0 commit comments

Comments
 (0)