[NI] Avoid constraints from expected type for effectively empty system

Expression will be checked against expected type later.

 Theoretically, this is not very good, but it aligns with the old
 inference, plus it helps avoiding multiple type mismatch diagnostics.
This commit is contained in:
Mikhail Zarechenskiy
2019-04-17 03:04:58 +03:00
parent 5dea14f4ce
commit bcc8802014
87 changed files with 130 additions and 125 deletions
@@ -20,11 +20,11 @@ operator fun Impl2.unaryMinus() = Impl2()
// See also KT-10384: in non-error functions, as is necessary!
fun add1(x: Impl2, y: Base): Impl1 = x as Base + y
fun error1(x: Impl2, y: Base): Impl1 = <!NI;TYPE_MISMATCH, TYPE_MISMATCH!>x + y<!>
fun error1(x: Impl2, y: Base): Impl1 = <!TYPE_MISMATCH!>x + y<!>
fun add2(x: Base, y: Impl2): Impl1 = x + y as Base
fun error2(x: Base, y: Impl2): Impl1 = <!NI;TYPE_MISMATCH, TYPE_MISMATCH!>x + y<!>
fun error2(x: Base, y: Impl2): Impl1 = <!TYPE_MISMATCH!>x + y<!>
fun minus3(x: Impl2): Impl1 = -(x as Base)