blob: 53db8897f9d9000f6d8507f5c8ba4df7389f0244 [file] [log] [blame]
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_EXPRESSION
object Test1 {
fun <T> foo(f: () -> T): T = f()
fun bar(): Int = 0
object Scope {
fun bar(x: Int = 0): String = ""
fun test() {
val result = foo(<!COMPATIBILITY_WARNING!>::bar<!>)
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int")!>result<!>
}
}
}
object Test2 {
fun foo(f: () -> Unit) {}
fun bar() {}
object Scope {
fun bar(): String = ""
fun test() {
foo(<!COMPATIBILITY_WARNING!>::bar<!>)
}
}
}
object Test3 {
fun <T> foo(f: (Int, Int) -> T): T = TODO()
fun bar(x: Int, y: Int): Int = 0
object Scope {
fun bar(vararg ints: Int): String = ""
fun test() {
val result = foo(<!COMPATIBILITY_WARNING!>::bar<!>)
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int")!>result<!>
}
}
}
object Test4 {
fun <T> foo(f: (Array<String>) -> T): T = TODO()
fun bar(g: Array<String>): Int = 0
object Scope {
// Works before 1.4
fun bar(vararg g: String): String = ""
fun test() {
val result = foo(::bar)
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String")!>result<!>
}
}
}