[NI] Move abstract class instantiation check to call checkers

This way the check works for callable reference arguments.
Also candidate applicability during resolution does not change compared to the old inference.
^KT-37530 Fixed
This commit is contained in:
Pavel Kirpichenkov
2020-03-17 11:46:26 +03:00
parent 3f00de5d7b
commit a416fde814
13 changed files with 195 additions and 17 deletions
@@ -0,0 +1,11 @@
// !WITH_NEW_INFERENCE
abstract class Abstract
fun <D> create(fn: () -> D): D {
return fn()
}
fun main() {
create(::Abstract)
}
@@ -0,0 +1,11 @@
// !WITH_NEW_INFERENCE
abstract class Abstract
fun <D> create(fn: () -> D): D {
return fn()
}
fun main() {
create(::<!CREATING_AN_INSTANCE_OF_ABSTRACT_CLASS, OI;CREATING_AN_INSTANCE_OF_ABSTRACT_CLASS, OI;CREATING_AN_INSTANCE_OF_ABSTRACT_CLASS!>Abstract<!>)
}
@@ -0,0 +1,11 @@
package
public fun </*0*/ D> create(/*0*/ fn: () -> D): D
public fun main(): kotlin.Unit
public abstract class Abstract {
public constructor Abstract()
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
}