File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
docs/docs/reference/contextual Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -262,15 +262,15 @@ object Eq {
262262
263263 def iterator [T ](p : T ) = p.asInstanceOf [Product ].productIterator
264264
265- def eqSum [T ](s : Mirror .SumOf [T ], elems : List [Eq [_]]): Eq [T ] =
265+ def eqSum [T ](s : Mirror .SumOf [T ], elems : => List [Eq [_]]): Eq [T ] =
266266 new Eq [T ] {
267267 def eqv (x : T , y : T ): Boolean = {
268268 val ordx = s.ordinal(x)
269269 (s.ordinal(y) == ordx) && check(elems(ordx))(x, y)
270270 }
271271 }
272272
273- def eqProduct [T ](p : Mirror .ProductOf [T ], elems : List [Eq [_]]): Eq [T ] =
273+ def eqProduct [T ](p : Mirror .ProductOf [T ], elems : => List [Eq [_]]): Eq [T ] =
274274 new Eq [T ] {
275275 def eqv (x : T , y : T ): Boolean =
276276 iterator(x).zip(iterator(y)).zip(elems.iterator).forall {
@@ -279,7 +279,7 @@ object Eq {
279279 }
280280
281281 inline given derived [T ](using m : Mirror .Of [T ]) as Eq [T ] = {
282- val elemInstances = summonAll[m.MirroredElemTypes ]
282+ lazy val elemInstances = summonAll[m.MirroredElemTypes ]
283283 inline m match {
284284 case s : Mirror .SumOf [T ] => eqSum(s, elemInstances)
285285 case p : Mirror .ProductOf [T ] => eqProduct(p, elemInstances)
You can’t perform that action at this time.
0 commit comments