@@ -662,15 +662,17 @@ object LazyList extends LazyListFactory[LazyList] {
662
662
def unapply [A ](xs : LazyList [A ]): Option [(A , LazyList [A ])] = #:: .unapply(xs)
663
663
}
664
664
665
- implicit final class Deferrer [A ](l : => LazyList [A ]) {
665
+ implicit def toDeferrer [A ](l : => LazyList [A ]): Deferrer [A ] = new Deferrer [A ](() => l)
666
+
667
+ final class Deferrer [A ] private [LazyList ] (private val l : () => LazyList [A ]) extends AnyVal {
666
668
/** Construct a LazyList consisting of a given first element followed by elements
667
669
* from another LazyList.
668
670
*/
669
- def #:: [B >: A ](elem : => B ): LazyList [B ] = newCons(elem, l)
671
+ def #:: [B >: A ](elem : => B ): LazyList [B ] = newCons(elem, l() )
670
672
/** Construct a LazyList consisting of the concatenation of the given LazyList and
671
673
* another LazyList.
672
674
*/
673
- def #::: [B >: A ](prefix : LazyList [B ]): LazyList [B ] = prefix lazyAppendedAll l
675
+ def #::: [B >: A ](prefix : LazyList [B ]): LazyList [B ] = prefix lazyAppendedAll l()
674
676
}
675
677
676
678
object #:: {
@@ -831,15 +833,17 @@ object Stream extends LazyListFactory[Stream] {
831
833
def unapply [A ](xs : Stream [A ]): Option [(A , Stream [A ])] = #:: .unapply(xs)
832
834
}
833
835
834
- implicit final class Deferrer [A ](l : => Stream [A ]) {
836
+ implicit def toDeferrer [A ](l : => Stream [A ]): Deferrer [A ] = new Deferrer [A ](() => l)
837
+
838
+ final class Deferrer [A ] private [Stream ] (private val l : () => Stream [A ]) extends AnyVal {
835
839
/** Construct a Stream consisting of a given first element followed by elements
836
840
* from another Stream.
837
841
*/
838
- def #:: [B >: A ](elem : => B ): Stream [B ] = newCons(elem, l)
842
+ def #:: [B >: A ](elem : => B ): Stream [B ] = newCons(elem, l() )
839
843
/** Construct a Stream consisting of the concatenation of the given Stream and
840
844
* another Stream.
841
845
*/
842
- def #::: [B >: A ](prefix : Stream [B ]): Stream [B ] = prefix lazyAppendedAll l
846
+ def #::: [B >: A ](prefix : Stream [B ]): Stream [B ] = prefix lazyAppendedAll l()
843
847
}
844
848
845
849
object #:: {
0 commit comments