File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed
main/scala-2.11_2.12/scala/collection/compat/immutable
test/scala/test/scala/collection Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -1180,6 +1180,7 @@ object LazyList extends SeqFactory[LazyList] {
1180
1180
/** Construct a LazyList consisting of a given first element followed by elements
1181
1181
* from another LazyList.
1182
1182
*/
1183
+ // def #::[B >: A](elem: => B): LazyList[B] = newLL(sCons(elem, l()))
1183
1184
def #:: [B >: A ](elem : B ): LazyList [B ] = newLL(sCons(elem, l()))
1184
1185
1185
1186
/** Construct a LazyList consisting of the concatenation of the given LazyList and
Original file line number Diff line number Diff line change @@ -52,13 +52,14 @@ class LazyListTest {
52
52
assertEquals(LazyList (None , Some (1 )), LazyList (None ) #::: LazyList (Some (1 )))
53
53
}
54
54
55
- @ Test
56
- def testLazyListDoesNotForceHead : Unit = {
55
+ @ Test
56
+ def testLazyListDoesNotForceHead : Unit = {
57
57
var i = 0
58
58
def f : Int = { i += 1 ; i }
59
- val s = LazyList .empty.#:: (f).#:: (f).#:: (f)
59
+ // val s = LazyList.empty.#::(f).#::(f).#::(f)
60
+ val s = LazyList .empty.#:: (f).#:: (f).#:: (f).#::: (LazyList .empty)
60
61
assertEquals(0 , i)
61
- }
62
+ }
62
63
63
64
@ Test
64
65
def testEmptyLazyListToString (): Unit = {
@@ -214,7 +215,8 @@ class LazyListTest {
214
215
215
216
var lazeCount = 0
216
217
def lazeL (i : Int ) = { lazeCount += 1 ; i }
217
- val xs21 = lazeL(1 ) #:: lazeL(2 ) #:: lazeL(3 ) #:: LazyList .empty
218
+ // val xs21 = lazeL(1) #:: lazeL(2) #:: lazeL(3) #:: LazyList.empty
219
+ val xs21 = LazyList .empty #::: lazeL(1 ) #:: lazeL(2 ) #:: lazeL(3 ) #:: LazyList .empty
218
220
219
221
assertEquals(0 , lazeCount)
220
222
}
You can’t perform that action at this time.
0 commit comments