commit | f61f771657a6011c7e2997d37013b319a0c0aee4 | [log] [tgz] |
---|---|---|
author | Denis.Zharkov <denis.zharkov@jetbrains.com> | Tue Dec 05 17:14:14 2023 +0100 |
committer | Denis.Zharkov <denis.zharkov@jetbrains.com> | Tue Dec 05 17:14:14 2023 +0100 |
tree | 11554fc59e9e5130d9e8b0f683eae739005cc4c6 | |
parent | 9b8e841a5fd534eb0779cab60c048313218b5d3a [diff] |
~ get rid of weird if + r2r
diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/coneDiagnosticToFirDiagnostic.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/coneDiagnosticToFirDiagnostic.kt index 3484810..1c34c3b 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/coneDiagnosticToFirDiagnostic.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/coneDiagnosticToFirDiagnostic.kt
@@ -422,8 +422,6 @@ if (morePreciseDiagnosticExists) return@firstNotNullOfOrNull null } - if (it is NewConstraintError && it.position.from is ExpectedTypeConstraintPosition<*>) return@firstNotNullOfOrNull null - FirErrors.NEW_INFERENCE_ERROR.createOn(qualifiedAccessSource ?: source, message) } )
diff --git a/compiler/testData/diagnostics/tests/inference/builderInference/constraints/violating.fir.kt b/compiler/testData/diagnostics/tests/inference/builderInference/constraints/violating.fir.kt index 4462de5..4ec385b 100644 --- a/compiler/testData/diagnostics/tests/inference/builderInference/constraints/violating.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/builderInference/constraints/violating.fir.kt
@@ -13,10 +13,10 @@ override fun foo(): MutableList<String> = <!RETURN_TYPE_MISMATCH!>this@buildList<!> } } - buildList { + <!NEW_INFERENCE_ERROR!>buildList { add(3) val x: String = <!INITIALIZER_TYPE_MISMATCH, TYPE_MISMATCH!>get(0)<!> - } + }<!> buildList { add("3") val x: MutableList<Int> = <!INITIALIZER_TYPE_MISMATCH!>this@buildList<!> @@ -26,8 +26,8 @@ add(y) val x: MutableList<String> = <!INITIALIZER_TYPE_MISMATCH!>this@buildList<!> } - buildList { + <!NEW_INFERENCE_ERROR!>buildList { add("") val x: StringBuilder = <!INITIALIZER_TYPE_MISMATCH, TYPE_MISMATCH!>get(0)<!> - } + }<!> }