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

31 lines
479 B
Kotlin
Vendored

// !CHECK_TYPE
// FILE: a.kt
package other
fun foo() {}
class A {
fun bar() = 42
}
fun A.baz(<!UNUSED_PARAMETER!>x<!>: String) {}
// FILE: b.kt
import kotlin.reflect.*
import other.foo as foofoo
import other.A as AA
import other.baz as bazbaz
fun main() {
val x = ::foofoo
val y = AA::bar
val z = AA::bazbaz
checkSubtype<KFunction0<Unit>>(x)
checkSubtype<KMemberFunction0<AA, Int>>(y)
checkSubtype<KExtensionFunction1<AA, String, Unit>>(z)
}