Files
kotlin-fork/compiler/testData/diagnostics/tests/resolve/overloadConflicts/genericWithProjection.kt
T
Dmitry Petrov a073f29006 KT-10460: use unsubstituted descriptors
while comparing overloaded generic functions  for specificity.
2016-01-18 12:25:04 +03:00

11 lines
365 B
Kotlin
Vendored

// !DIAGNOSTICS: -UNUSED_PARAMETER -REDUNDANT_PROJECTION
class In<in T>() {
fun f(t : T) {}
fun f(t : Int) = t
}
fun test1(x: In<String>): Unit = x.f("1")
fun test2(x: In<in String>): Unit = x.f("1")
fun test3(x: In<<!CONFLICTING_PROJECTION!>out<!> String>): Unit = x.<!NONE_APPLICABLE!>f<!>("1")
fun test4(x: In<*>): Unit = x.<!NONE_APPLICABLE!>f<!>("1")