try to use bounds in type inference
if some parameters are unknown
This commit is contained in:
+11
@@ -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<!>
|
||||
}
|
||||
Reference in New Issue
Block a user