@@ -30,11 +30,17 @@ trait SeqViewOps[+A, +CC[_], +C] extends Any with IterableOps[A, CC, C] {
30
30
def length : Int
31
31
def apply (x : Int ): A
32
32
def appended [B >: A ](elem : B ): CC [B ]^ {this }
33
- def updated [B >: A ](index : Int , elem : B ): CC [B ]^ {this }
34
33
def prepended [B >: A ](elem : B ): CC [B ]^ {this }
35
34
def reverse : C ^ {this }
36
35
def sorted [B >: A ](implicit ord : Ordering [B ]): C ^ {this }
37
36
37
+ // Placeholder implementation for that method in SeqOps.
38
+ // This is needed due to the change in the class hierarchy in cc stdlib.
39
+ // See #19660 and #19819.
40
+ def updated [B >: A ](index : Int , elem : B ): CC [B ]^ {this } =
41
+ assert(false , " This is a placeholder implementation in the capture checked Scala 2 library." )
42
+ ???
43
+
38
44
def reverseIterator : Iterator [A ]^ {this } = reversed.iterator
39
45
}
40
46
@@ -46,15 +52,6 @@ trait SeqView[+A] extends SeqViewOps[A, View, View[A]] with View[A] {
46
52
override def map [B ](f : A => B ): SeqView [B ]^ {this , f} = new SeqView .Map (this , f)
47
53
override def appended [B >: A ](elem : B ): SeqView [B ]^ {this } = new SeqView .Appended (this , elem)
48
54
49
- // Copied from SeqOps. This is needed due to the change of class hierarchy in stdlib.
50
- // See #19660.
51
- override def updated [B >: A ](index : Int , elem : B ): View [B ]^ {this } = {
52
- if (index < 0 ) throw new IndexOutOfBoundsException (index.toString)
53
- val k = knownSize
54
- if (k >= 0 && index >= k) throw new IndexOutOfBoundsException (index.toString)
55
- iterableFactory.from(new View .Updated (this , index, elem))
56
- }
57
-
58
55
override def prepended [B >: A ](elem : B ): SeqView [B ]^ {this } = new SeqView .Prepended (elem, this )
59
56
override def reverse : SeqView [A ]^ {this } = new SeqView .Reverse (this )
60
57
override def take (n : Int ): SeqView [A ]^ {this } = new SeqView .Take (this , n)
0 commit comments