KT-6081 Chained generic method calls: wrong type inference

#KT-6081 Fixed
This commit is contained in:
Svetlana Isakova
2014-11-24 18:10:23 +03:00
parent 9c880de735
commit 724f2e6e7b
12 changed files with 295 additions and 17 deletions
@@ -0,0 +1,22 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
class Outer<T> {
inner class Inner<I> {
fun getOuter(): Outer<T> = this@Outer
fun <R> genericFun(r: R): Outer<T> = this@Outer
}
fun useOuterParam(t: T) {}
}
fun test1() {
Outer<Int>().Inner<String>().getOuter().useOuterParam(22)
Outer<Int>().Inner<String>().getOuter().useOuterParam(<!TYPE_MISMATCH!>""<!>)
}
class A
class B
fun test1(a: A, b: B) {
Outer<Int>().Inner<String>().genericFun(a).Inner<Double>().genericFun(b)
}