K2: Fix processing inference lower bound NullableType <: T & Any

This commit is a follow-up to 0d070f8ba9.
Here we remove accidentally returning "Not a sub-type" for a constraint
like TypeVariable <: DNN type

#KT-59241 Fixed
This commit is contained in:
Mikhail Glukhikh
2023-06-12 15:01:30 +02:00
committed by Space Team
parent ab1d634ad3
commit 35b475f9f7
3 changed files with 6 additions and 26 deletions
@@ -1,23 +0,0 @@
// FULL_JDK
// FILE: JavaClass.java
import java.util.function.Supplier;
import org.jetbrains.annotations.NotNull;
public class JavaClass {
public static <E> void consume(@NotNull E value) {}
public static <E> void compute(Supplier<@NotNull E> computable) {}
}
// FILE: KotlinMain.kt
fun test1() {
JavaClass.compute { <!ARGUMENT_TYPE_MISMATCH!>42.apply {}<!> }
}
fun test2() {
JavaClass.compute { <!ARGUMENT_TYPE_MISMATCH!>if (true) 42 else 42<!> }
}
fun test3() {
42.<!INAPPLICABLE_CANDIDATE!>apply<!>(JavaClass::<!UNRESOLVED_REFERENCE!>consume<!>)
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// FULL_JDK
// FILE: JavaClass.java