[NI] Fix inference if inner system has only by "uninteresting" constraint
#KT-32250 fixed
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
// !LANGUAGE: +NewInference
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE
|
||||
|
||||
interface I {
|
||||
fun foo()
|
||||
}
|
||||
|
||||
data class Pair<X, Y>(val fst: X, val snd: Y)
|
||||
|
||||
class A(f: Pair<Int, (I) -> Unit>? = null)
|
||||
|
||||
class B(f: ((I) -> Unit)? = null)
|
||||
|
||||
fun main() {
|
||||
val cond = true
|
||||
A(
|
||||
if (cond) {
|
||||
Pair(1, { baz -> baz.foo() })
|
||||
} else {
|
||||
null
|
||||
}
|
||||
)
|
||||
B(
|
||||
if (cond) {
|
||||
{ baz -> baz.foo() }
|
||||
} else {
|
||||
null
|
||||
}
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package
|
||||
|
||||
public fun main(): kotlin.Unit
|
||||
|
||||
public final class A {
|
||||
public constructor A(/*0*/ f: Pair<kotlin.Int, (I) -> kotlin.Unit>? = ...)
|
||||
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 B {
|
||||
public constructor B(/*0*/ f: ((I) -> kotlin.Unit)? = ...)
|
||||
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 interface I {
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public abstract fun foo(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public final data class Pair</*0*/ X, /*1*/ Y> {
|
||||
public constructor Pair</*0*/ X, /*1*/ Y>(/*0*/ fst: X, /*1*/ snd: Y)
|
||||
public final val fst: X
|
||||
public final val snd: Y
|
||||
public final operator /*synthesized*/ fun component1(): X
|
||||
public final operator /*synthesized*/ fun component2(): Y
|
||||
public final /*synthesized*/ fun copy(/*0*/ fst: X = ..., /*1*/ snd: Y = ...): Pair<X, Y>
|
||||
public open override /*1*/ /*synthesized*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*synthesized*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*synthesized*/ fun toString(): kotlin.String
|
||||
}
|
||||
Reference in New Issue
Block a user