try to use bounds in type inference

if some parameters are unknown
This commit is contained in:
Svetlana Isakova
2013-04-03 15:07:09 +04:00
parent 2a36da9549
commit 8f1b728a08
3 changed files with 45 additions and 15 deletions
@@ -0,0 +1,11 @@
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<!>
}