Files
kotlin/compiler/testData/diagnostics/tests/callableReference/resolve/withExtFun.kt
Alexander Udalov 239502368a Update test data for tower resolution algorithm
- locals win
- unary calls to plus/minus are not supported in favor of unaryPlus/unaryMinus
- unqualified nested classes are temporarily reported as unresolved
- function without receiver win against extension function
- explicit import win against star import
2015-12-11 17:01:02 +03:00

28 lines
578 B
Kotlin
Vendored

// !DIAGNOSTICS: -UNUSED_PARAMETER
import kotlin.reflect.*
fun <T> ofType(x: T): T = x
class A {
val foo: Int = 0
fun foo() {}
fun bar() {}
val bar: Int = 0
}
fun A.foo(): String = "A"
val x0 = A::<!OVERLOAD_RESOLUTION_AMBIGUITY!>foo<!>
val x1 = ofType<(A) -> Unit>(A::foo)
val x2 = ofType<KProperty1<A, Int>>(A::foo)
val x3: KProperty1<A, Int> = A::foo
val x4: (A) -> String = A::foo
val y0 = A::<!OVERLOAD_RESOLUTION_AMBIGUITY!>bar<!>
val y1 = ofType<(A) -> Unit>(A::bar)
val y2 = ofType<KProperty1<A, Int>>(A::bar)
val y3: KProperty1<A, Int> = A::bar