[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:
+3
-3
@@ -8,15 +8,15 @@ fun test(a: Int?, b: Int?) {
|
||||
}
|
||||
|
||||
fun test(a: Int?, b: Int?, c: Int?) {
|
||||
bar(<!NI;TYPE_MISMATCH, NI;TYPE_MISMATCH!>if (a == null) return else if (b == null) return else <!OI;TYPE_MISMATCH!>c<!><!>)
|
||||
bar(<!NI;TYPE_MISMATCH!>if (a == null) return else if (b == null) return else <!OI;TYPE_MISMATCH!>c<!><!>)
|
||||
}
|
||||
|
||||
fun test(a: Any?, b: Any?, c: Int?) {
|
||||
bar(<!NI;TYPE_MISMATCH, NI;TYPE_MISMATCH!>if (a == null) if (b == null) <!OI;TYPE_MISMATCH!>c<!> else return else return<!>)
|
||||
bar(<!NI;TYPE_MISMATCH!>if (a == null) if (b == null) <!OI;TYPE_MISMATCH!>c<!> else return else return<!>)
|
||||
}
|
||||
|
||||
fun test(a: Int?, b: Any?, c: Int?) {
|
||||
bar(<!NI;TYPE_MISMATCH, NI;TYPE_MISMATCH!>if (a == null) {
|
||||
bar(<!NI;TYPE_MISMATCH!>if (a == null) {
|
||||
return
|
||||
} else {
|
||||
if (b == null) {
|
||||
|
||||
Reference in New Issue
Block a user