Files
kotlin-fork/compiler/testData/codegen/box/package/referenceWithTheSameNameAsPackage.kt
T
Mikhail Zarechenskiy aebcb61402 Resolve elements in chain of qualifier expression without expected type
Consider call chain `foo.bar.baz()` which has expected type `Int`
Elements `foo` and `bar` doesn't have expected type `Int`,
this is especially important in NI, because we use expected type for
candidate applicability
2018-03-30 14:51:07 +03:00

23 lines
350 B
Kotlin
Vendored

// !LANGUAGE: +NewInference
// WITH_RUNTIME
// FILE: messages/foo.kt
package messages
fun foo() {}
// FILE: sample.kt
class Test {
val messages = arrayListOf<String>()
fun test(): Boolean {
return messages.any { it == "foo" }
}
}
fun box(): String {
val result = Test().test()
return if (result) "faile" else "OK"
}