File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -217,11 +217,11 @@ extension [ValueType](iterable: Iterable[ValueType])
217
217
218
218
extension [ElemType ](value : IArray [ElemType ])
219
219
inline def mutable (using Unsafe ): Array [ElemType ] = value.asMatchable.runtimeChecked match
220
- case array : Array [ElemType ] => array
220
+ case array : ( Array [ElemType ] @ unchecked) => array
221
221
222
222
extension [ElemType ](array : Array [ElemType ])
223
223
def immutable (using Unsafe ): IArray [ElemType ] = array.runtimeChecked match
224
- case array : IArray [ElemType ] => array
224
+ case array : ( IArray [ElemType ] @ unchecked) => array
225
225
226
226
def snapshot (using ClassTag [ElemType ]): IArray [ElemType ] =
227
227
val newArray = new Array [ElemType ](array.length)
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ object Indexable:
32
32
type Result = ElementType
33
33
34
34
def contains (array : IArray [ElementType ], index : Ordinal ): Boolean =
35
- index.n0 >= 0 && index.n0 <= Ult .of(array.length ).n0
35
+ index.n0 >= 0 && index.n0 <= Ult .of(array).n0
36
36
37
37
def access (array : IArray [ElementType ], index : Ordinal ): Result = array(index.n0)
38
38
@@ -43,7 +43,7 @@ object Indexable:
43
43
type Result = ElementType
44
44
45
45
def contains (seq : IndexedSeq [ElementType ], index : Ordinal ): Boolean =
46
- index.n0 >= 0 && index.n0 <= Ult .of(seq.length ).n0
46
+ index.n0 >= 0 && index.n0 <= Ult .of(seq).n0
47
47
48
48
def access (seq : IndexedSeq [ElementType ], index : Ordinal ): Result = seq(index.n0)
49
49
@@ -53,7 +53,7 @@ object Indexable:
53
53
type Result = Char
54
54
55
55
def contains (text : Text , index : Ordinal ): Boolean =
56
- index.n0 >= 0 && index.n0 <= Ult .of( text).n0
56
+ index.n0 >= 0 && index.n0 < text.s.length
57
57
58
58
def access (text : Text , index : Ordinal ): Result = text.s.charAt(index.n0)
59
59
You can’t perform that action at this time.
0 commit comments