Rethink constraints incorporation

Namely, remove incorporation “otherInsideMyConstraint” to eliminate
constraint system redundancy and produce a potentially very large number
 of constructs.
Instead, introduce not so “spreadable” incorporation during variable
fixation (equality constraint with result type into other constraints).
^KT-41644 Fixed
^KT-42195 Fixed
^KT-42920 Fixed
^KT-42791 Fixed
^KT-41741 Fixed
This commit is contained in:
Victor Petukhov
2020-11-19 12:39:57 +03:00
parent 616e40f879
commit 0857b9c9e7
24 changed files with 299 additions and 136 deletions
@@ -59,11 +59,11 @@ fun testVariableWithBound() {
<!DEBUG_INFO_EXPRESSION_TYPE("Inv<kotlin.Int>")!>c1<!>
val c2 = <!TYPE_MISMATCH!>select<!>(SubInv<String>(), createWithNumberBound())
val c2 = <!TYPE_MISMATCH!>select<!>(SubInv<String>(), <!TYPE_MISMATCH!>createWithNumberBound<!>())
<!DEBUG_INFO_EXPRESSION_TYPE("Inv<kotlin.String>")!>c2<!>
val c3 = <!TYPE_MISMATCH!>select<!>(SubInv<Double>(), createWithIntBound())
val c3 = <!TYPE_MISMATCH!>select<!>(SubInv<Double>(), <!TYPE_MISMATCH!>createWithIntBound<!>())
<!DEBUG_INFO_EXPRESSION_TYPE("Inv<kotlin.Double>")!>c3<!>
}