File tree 2 files changed +6
-7
lines changed 2 files changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -886,11 +886,11 @@ object CollectionStrawMan6 extends LowPriority {
886
886
}
887
887
888
888
/** View defined in terms of indexing a range */
889
- trait IndexedView [+ A ] extends View [A ] with ArrayLike [A ] {
889
+ trait IndexedView [+ A ] extends View [A ] with ArrayLike [A ] { self =>
890
890
891
891
def iterator : Iterator [A ] = new Iterator [A ] {
892
892
private var current = 0
893
- def hasNext = current < length
893
+ def hasNext = current < self. length
894
894
def next : A = {
895
895
val r = apply(current)
896
896
current += 1
@@ -908,7 +908,7 @@ object CollectionStrawMan6 extends LowPriority {
908
908
909
909
class Take [A ](underlying : IndexedView [A ], n : Int )
910
910
extends View .Take (underlying, n) with IndexedView [A ] {
911
- override def iterator = super .iterator
911
+ override def iterator = super .iterator // needed to avoid "conflicting overrides" error
912
912
def length = underlying.length min normN
913
913
def apply (i : Int ) = underlying.apply(i)
914
914
}
Original file line number Diff line number Diff line change 1
- package colltest6
2
1
package strawman .collections
3
2
4
3
import Predef .{augmentString => _ , wrapString => _ , _ }
@@ -887,11 +886,11 @@ object CollectionStrawMan6 extends LowPriority {
887
886
}
888
887
889
888
/** View defined in terms of indexing a range */
890
- trait IndexedView [+ A ] extends View [A ] with ArrayLike [A ] {
889
+ trait IndexedView [+ A ] extends View [A ] with ArrayLike [A ] { self =>
891
890
892
891
def iterator : Iterator [A ] = new Iterator [A ] {
893
892
private var current = 0
894
- def hasNext = current < length
893
+ def hasNext = current < self. length
895
894
def next : A = {
896
895
val r = apply(current)
897
896
current += 1
@@ -909,7 +908,7 @@ object CollectionStrawMan6 extends LowPriority {
909
908
910
909
class Take [A ](underlying : IndexedView [A ], n : Int )
911
910
extends View .Take (underlying, n) with IndexedView [A ] {
912
- override def iterator = super .iterator
911
+ override def iterator = super .iterator // needed to avoid "conflicting overrides" error
913
912
def length = underlying.length min normN
914
913
def apply (i : Int ) = underlying.apply(i)
915
914
}
You can’t perform that action at this time.
0 commit comments