K2: Use correct position for substitution constrains in builder inference

Before, we were wrapping the original constraint position into
ConeBuilderInferenceSubstitutionConstraintPosition twice during the
constraint substitution in builder inference.

It was causing problems with diagnostic reporting.

Remove TODOs about diagnostic reporting from FirBuilderInferenceSession.
Propagation of errors from the common system is now implemented
Diagnostic reporting in updateCalls isn't needed, since we
report errors after the system completion unlike K1

Relates to KT-53749
This commit is contained in:
Simon Ogorodnik
2023-12-01 23:09:06 +01:00
committed by Space Team
parent 2f367b013a
commit d46075a9db
9 changed files with 33 additions and 32 deletions
@@ -13,7 +13,7 @@ fun main() {
override fun foo(): MutableList<String> = <!RETURN_TYPE_MISMATCH!>this@buildList<!>
}
}
<!NEW_INFERENCE_ERROR!>buildList {
<!TYPE_MISMATCH!>buildList {
add(3)
val x: String = <!INITIALIZER_TYPE_MISMATCH!>get(0)<!>
}<!>
@@ -26,7 +26,7 @@ fun main() {
add(y)
val x: MutableList<String> = <!INITIALIZER_TYPE_MISMATCH!>this@buildList<!>
}
<!NEW_INFERENCE_ERROR!>buildList {
<!TYPE_MISMATCH!>buildList {
add("")
val x: StringBuilder = <!INITIALIZER_TYPE_MISMATCH!>get(0)<!>
}<!>