Improve inference on generics for callable references

#KT-10711 Fixed
 #KT-12802 Fixed
 #KT-12964 Fixed
 #KT-15439 Fixed

Analyze callable references in `dependent` mode, then complete them with
respect to expected types
This commit is contained in:
Mikhail Zarechenskiy
2017-01-17 02:30:16 +03:00
parent 07bb7ef4d3
commit 2cac6a9e7d
50 changed files with 938 additions and 22 deletions
@@ -0,0 +1,27 @@
package
public fun </*0*/ T, /*1*/ R, /*2*/ S> bar(/*0*/ f: T.(R) -> S): Tripple<T, R, S>
public fun </*0*/ T, /*1*/ R, /*2*/ S> baz(/*0*/ x: T, /*1*/ y: R, /*2*/ z: S, /*3*/ f: T.(R) -> S): Tripple<T, R, S>
public fun test1(): kotlin.Unit
public fun </*0*/ T> test2(): kotlin.Unit
public fun </*0*/ R, /*1*/ S> Wrapper.foo(/*0*/ x: R): S
public fun Wrapper.fooIntString(/*0*/ x: kotlin.Int): kotlin.String
public fun </*0*/ T> Wrapper.fooReturnString(/*0*/ x: T): kotlin.String
public fun </*0*/ T> Wrapper.fooTakeInt(/*0*/ x: kotlin.Int): T
public final class Tripple</*0*/ A, /*1*/ B, /*2*/ C> {
public constructor Tripple</*0*/ A, /*1*/ B, /*2*/ C>(/*0*/ a: A, /*1*/ b: B, /*2*/ c: C)
public final val a: A
public final val b: B
public final val c: C
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public final class Wrapper {
public constructor Wrapper()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}