Files
kotlin-fork/js/js.translator/testData/nameClashes/cases/extensionFunctionAndProperty.kt
T
Ilya Gorbunov f604eef2fe Undeprecate find(predicate) and generate it for all collection-like types. Provide findLast(predicate).
Drop deprecated method findNot and extension properties first, last, head, tail
#KT-5185 Fixed
2015-07-24 04:28:46 +03:00

18 lines
408 B
Kotlin
Vendored

package foo
public fun <T> List<T>.some(): T = this[0]
public fun String.some(): Char = this[0]
public val <T> List<T>.some: T get() = this[1]
public val String.some: Char get() = this[1]
fun box(): String {
val data = listOf("foo", "bar")
assertEquals("foo", data.some())
assertEquals("bar", data.some)
assertEquals('f', "foo".some())
assertEquals('a', "bar".some)
return "OK"
}