Files
kotlin-fork/compiler/testData/diagnostics/tests/inference/regressions/kt1358.kt
T
2014-10-01 18:52:52 +04:00

12 lines
295 B
Kotlin
Vendored

//KT-1358 Overload resolution ambiguity with smartcast and generic function
package d
fun bar(a: Any?) {
if (a != null) {
a.foo() //overload resolution ambiguity
a.sure() //overload resolution ambiguity
}
}
fun <T : Any> T?.foo() {}
fun <T : Any> T?.sure() : T = this!!