[NI] Complete call if return type has proper lower or equal constraints

There was a silly bug: equal constraint is actually a lower and an upper
 constraint, but we checked only presence of lower constraints.

 Test is important as here we have one equal constraint and should
 complete inner call `foo<Int>()` without propagating it to `bar` to
 avoid using `NoInfer` annotation multiple times
This commit is contained in:
Mikhail Zarechenskiy
2019-05-08 02:45:24 +03:00
parent 6c9394f0b2
commit 61bd3a8d03
4 changed files with 19 additions and 3 deletions
@@ -19,8 +19,8 @@ fun test(i: Int?) {
foo(<!REDUNDANT_LABEL_WARNING!>l4@<!> <!TYPE_MISMATCH!>""<!>)
foo((<!TYPE_MISMATCH!>""<!>))
foo(checkSubtype<Int>(<!NI;TYPE_MISMATCH, NI;TYPE_MISMATCH, TYPE_MISMATCH!>""<!>))
foo(<!NI;TYPE_MISMATCH, TYPE_MISMATCH!>checkSubtype<Long>(<!NI;TYPE_MISMATCH, NI;TYPE_MISMATCH, TYPE_MISMATCH!>""<!>)<!>)
foo(checkSubtype<Int>(<!TYPE_MISMATCH!>""<!>))
foo(<!TYPE_MISMATCH!>checkSubtype<Long>(<!TYPE_MISMATCH!>""<!>)<!>)
use(a, b, c, d)
}