Files
kotlin-fork/compiler/testData/diagnostics/tests/smartCasts/kt1461.kt
T
Svetlana Isakova 7b6dfc3470 small fix while choosing maximally specific
return success if there is one candidate after filterOverrides step
 #KT-1461 fixed
2013-03-11 14:54:16 +04:00

18 lines
517 B
Kotlin

//KT-1461 Front-end complains on overload resolution when superclass property is accessed from string template and implicit type cast is performed
package f
open class Super(val property : String) {}
class Sub(str : String) : Super(str) {}
fun foo(sup : Super, sub : Sub) {
if (sup is Sub) {
println("${sup.property}")
println(sup.property)
}
println("${sub.property}")
println(sub.property)
}
//from library
fun println(<!UNUSED_PARAMETER!>message<!> : Any?) { throw Exception() }