Ensure that {Collection, CharSequence}.indices intrinsic works with 'in'
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun testCharSequence(i: Int, cs: CharSequence) = i in cs.indices
|
||||
|
||||
// 0 INVOKESTATIC kotlin/text/StringsKt.getIndices
|
||||
// 0 INVOKEVIRTUAL kotlin/ranges/IntRange.contains
|
||||
// 1 INVOKEINTERFACE java/lang/CharSequence.length
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun testCollection(i: Int, xs: List<Any>) = i in xs.indices
|
||||
|
||||
// 0 INVOKESTATIC kotlin/collections/CollectionsKt.getIndices
|
||||
// 0 INVOKEVIRTUAL kotlin/ranges/IntRange.contains
|
||||
// 1 INVOKEINTERFACE java/util/Collection.size
|
||||
Reference in New Issue
Block a user