complete type inference(*) for variable as function call as well

* dependent on expected type
+ get rid of instanceof ResolvedCallImpl check
This commit is contained in:
Svetlana Isakova
2013-02-28 15:45:40 +04:00
parent fe82ea5464
commit 1d55e359a5
11 changed files with 88 additions and 54 deletions
@@ -0,0 +1,16 @@
package j
trait MyFunc<T> {}
class A(val b: B) {
}
class B {
fun <T> invoke(<!UNUSED_PARAMETER!>f<!>: (T) -> T): MyFunc<T> = throw Exception()
}
fun id<R>(r: R) = r
fun foo(a: A) {
val <!UNUSED_VARIABLE!>r<!> : MyFunc<Int> = id (a.b { x -> x + 14 })
}