Fix bug when onEach extension call is not found for arrays

This commit is contained in:
Vitaliy.Bibaev
2017-11-24 13:36:52 +03:00
committed by Yan Zhulanow
parent aa7f1073e6
commit 7c417a59dc
2 changed files with 43 additions and 16 deletions
@@ -2,15 +2,18 @@ LineBreakpoint created at FilterPrimitiveAsTermination.kt:5
Run Java
Connected to the target VM
FilterPrimitiveAsTermination.kt:5
Exception caught: junit.framework.AssertionFailedError: Unresolved reference. None of the following candidates is applicable because of receiver type mismatch:
@SinceKotlin public inline fun <S : CharSequence> ???.onEach(action: (Char) -> Unit): ??? defined in kotlin.text
@SinceKotlin public inline fun <T, C : Iterable<???>> ByteArray.onEach(action: (???) -> Unit): ByteArray defined in kotlin.collections
@SinceKotlin public inline fun <K, V, M : Map<out ???, ???>> ByteArray.onEach(action: (Map.Entry<???, ???>) -> Unit): ByteArray defined in kotlin.collections
@SinceKotlin public fun <T> Sequence<???>.onEach(action: (???) -> Unit): Sequence<???> defined in kotlin.sequences, Unresolved reference. None of the following candidates is applicable because of receiver type mismatch:
@SinceKotlin public inline fun <S : CharSequence> ???.onEach(action: (Char) -> Unit): ??? defined in kotlin.text
@SinceKotlin public inline fun <T, C : Iterable<???>> ByteArray.onEach(action: (???) -> Unit): ByteArray defined in kotlin.collections
@SinceKotlin public inline fun <K, V, M : Map<out ???, ???>> ByteArray.onEach(action: (Map.Entry<???, ???>) -> Unit): ByteArray defined in kotlin.collections
@SinceKotlin public fun <T> Sequence<???>.onEach(action: (???) -> Unit): Sequence<???> defined in kotlin.sequences
byteArrayOf(1, 3, 50).asIterable()
.filter({ it == 50.toByte() })
filter
before: 4,6,8
after: 8
mappings for filter
direct:
4 -> nothing
6 -> nothing
8 -> 8
reverse:
8 <- 8
Disconnected from the target VM
WRONG!