[IR] Filter chars and codePoints from allowed to interpret function
These two functions apparently are represented in Kotlin as methods of `kotlin.String`. Because of that we accidentally treated them as builtins. To also minimize such cases, added filtration by return type. We are allowing to interpret only these functions that have primitive or unsigned return type. #KT-57028 Fixed
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
// TARGET_BACKEND: JVM
|
||||
// WITH_STDLIB
|
||||
// FULL_JDK
|
||||
|
||||
// java.lang.NoSuchMethodError: java.lang.String.chars
|
||||
// IGNORE_BACKEND: ANDROID
|
||||
import kotlin.streams.toList
|
||||
|
||||
fun box(): String {
|
||||
val shoulNotBeEveluated1 = "HelloWorld".chars()
|
||||
val shoulNotBeEveluated2 = "HelloWorld".codePoints()
|
||||
val shoulNotBeEveluated3 = "HelloWorld".chars().toList().groupBy { it }.map { it.key to it.value.size }.joinToString().also(::println)
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user