Files
kotlin/compiler/testData/diagnostics/tests/callableReference/function/differentPackageTopLevel.kt
2015-05-26 14:27:40 +03:00

29 lines
416 B
Kotlin
Vendored

// !CHECK_TYPE
// FILE: a.kt
package first
fun foo() {}
fun bar(<!UNUSED_PARAMETER!>x<!>: Int) {}
fun baz() = "OK"
// FILE: b.kt
package other
import kotlin.reflect.*
import first.foo
import first.bar
import first.baz
fun main() {
val x = ::foo
val y = ::bar
val z = ::baz
checkSubtype<KFunction0<Unit>>(x)
checkSubtype<KFunction1<Int, Unit>>(y)
checkSubtype<KFunction0<String>>(z)
}