Skip to content

Commit 5c2a19b

Browse files
committed
OfTypeImplicits: compute refs lazily
Many intermediate `OfTypeImplicits` are created during a call to `implicitScope`, but they won't all be used so there is no need to compute `OfTypeImplicits#refs` unless it's actually used.
1 parent 221e5d1 commit 5c2a19b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/dotty/tools/dotc/typer/Implicits.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ object Implicits {
106106
*/
107107
class OfTypeImplicits(tp: Type, val companionRefs: TermRefSet)(initctx: Context) extends ImplicitRefs(initctx) {
108108
assert(initctx.typer != null)
109-
val refs: List[TermRef] = {
109+
lazy val refs: List[TermRef] = {
110110
val buf = new mutable.ListBuffer[TermRef]
111111
for (companion <- companionRefs) buf ++= companion.implicitMembers
112112
buf.toList

0 commit comments

Comments
 (0)