[NI] Implement algorithm for completion mode selection

Current selection of completion mode for call is not always correct in case of full mode,
and sometimes too conservative in case of partial mode. Updated algorithm checks constraints
wrt position of type variables in return type and in other related constraints.
Full completion happens if proper constraint requirements are satisfied for variables.
This commit is contained in:
Pavel Kirpichenkov
2019-12-16 19:02:03 +03:00
parent a9391c8dfb
commit e9941f8c12
17 changed files with 735 additions and 64 deletions
@@ -0,0 +1,42 @@
package
public fun </*0*/ K> id(/*0*/ arg: K): K
public fun test1(/*0*/ arg: Derived): kotlin.Unit
public fun test2(/*0*/ derived: Derived, /*1*/ other: Other): kotlin.Unit
public fun </*0*/ R> Inv<R>.select(/*0*/ first: R, /*1*/ second: R): R
public interface Base {
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 Derived : Base {
public constructor Derived()
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 Inv</*0*/ I> {
public constructor Inv</*0*/ I>(/*0*/ arg: I)
public final val arg: I
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 InvExact</*0*/ E> {
public constructor InvExact</*0*/ E>(/*0*/ arg: E)
public final val arg: E
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 Other : Base {
public constructor Other()
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
}