Files
kotlin-fork/compiler/testData/diagnostics/tests/inference/upperBounds/useBoundsIfUnknownParameters.kt
T
Svetlana Isakova 8f1b728a08 try to use bounds in type inference
if some parameters are unknown
2013-04-03 15:51:17 +04:00

11 lines
249 B
Kotlin

package Hello
open class Base<T>
class StringBase : Base<String>()
class Client<T, X: Base<T>>(x: X)
fun test() {
val c = Client(StringBase()) // Type inference fails here for T.
val <!UNUSED_VARIABLE!>i<!> : Int = <!TYPE_MISMATCH!>c<!>
}