Fix exception when expected type is subtype of a function type
#KT-28984 Fixed #EA-132850 Fixed
This commit is contained in:
Vendored
+12
@@ -0,0 +1,12 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
abstract class SubFunction : kotlin.Function0<Unit>
|
||||
|
||||
fun <T> takeIt(x: T, f: SubFunction) {}
|
||||
|
||||
fun cr() {}
|
||||
|
||||
fun test() {
|
||||
<!TYPE_INFERENCE_PARAMETER_CONSTRAINT_ERROR!>takeIt<!>(42, <!TYPE_MISMATCH!>::cr<!>)
|
||||
<!TYPE_INFERENCE_PARAMETER_CONSTRAINT_ERROR!>takeIt<!>(42, <!TYPE_MISMATCH!>{ }<!>)
|
||||
}
|
||||
Vendored
+13
@@ -0,0 +1,13 @@
|
||||
package
|
||||
|
||||
public fun cr(): kotlin.Unit
|
||||
public fun </*0*/ T> takeIt(/*0*/ x: T, /*1*/ f: SubFunction): kotlin.Unit
|
||||
public fun test(): kotlin.Unit
|
||||
|
||||
public abstract class SubFunction : () -> kotlin.Unit {
|
||||
public constructor SubFunction()
|
||||
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 abstract override /*1*/ /*fake_override*/ fun invoke(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
Reference in New Issue
Block a user