[NI] Do not avoid trivial constraints if they aren't from upper bounds
Since we skipped trivial constraint with `Any?` from parameter type of function `equals`, the compiler thought that there is no proper constraints (upper bounds do not matter here) and marked resolved call as a failed one, then diagnostic about missing equals was added Also, tune `TrivialConstraintTypeInferenceOracle` for `Any?`-like constraints #KT-30724 Fixed
This commit is contained in:
+11
@@ -0,0 +1,11 @@
|
||||
// !LANGUAGE: +NewInference
|
||||
|
||||
interface Base
|
||||
|
||||
fun <K> materialize(): K = TODO()
|
||||
|
||||
fun <T : Base> Base.transform(): T = materialize()
|
||||
|
||||
fun test(child: Base) {
|
||||
child == child.transform()
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
package
|
||||
|
||||
public fun </*0*/ K> materialize(): K
|
||||
public fun test(/*0*/ child: Base): kotlin.Unit
|
||||
public fun </*0*/ T : Base> Base.transform(): T
|
||||
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user