diff --git a/compiler/fir/raw-fir/light-tree2fir/src/org/jetbrains/kotlin/fir/lightTree/converter/LightTreeRawFirDeclarationBuilder.kt b/compiler/fir/raw-fir/light-tree2fir/src/org/jetbrains/kotlin/fir/lightTree/converter/LightTreeRawFirDeclarationBuilder.kt index e73360a418f..abafe90a822 100644 --- a/compiler/fir/raw-fir/light-tree2fir/src/org/jetbrains/kotlin/fir/lightTree/converter/LightTreeRawFirDeclarationBuilder.kt +++ b/compiler/fir/raw-fir/light-tree2fir/src/org/jetbrains/kotlin/fir/lightTree/converter/LightTreeRawFirDeclarationBuilder.kt @@ -1456,7 +1456,9 @@ class LightTreeRawFirDeclarationBuilder( contextReceivers.addAll(convertContextReceivers(property)) }.also { - fillDanglingConstraintsTo(firTypeParameters, typeConstraints, it) + if (!isLocal) { + fillDanglingConstraintsTo(firTypeParameters, typeConstraints, it) + } } } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/local-variables/type-parameters/neg/1.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/local-variables/type-parameters/neg/1.fir.kt index e86ede1d679..0b7b2fc894d 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/local-variables/type-parameters/neg/1.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/local-variables/type-parameters/neg/1.fir.kt @@ -32,8 +32,8 @@ fun case_3() { // TESTCASE NUMBER: 4 fun case_4() { - val y1: Number where __UNRESOLVED__: __UNRESOLVED__ = 1 - var y2: Number where __UNRESOLVED__: __UNRESOLVED__ = 1 + val y1: Number where __UNRESOLVED__: __UNRESOLVED__ = 1 + var y2: Number where __UNRESOLVED__: __UNRESOLVED__ = 1 } // TESTCASE NUMBER: 5 @@ -94,8 +94,8 @@ fun case_12() { // TESTCASE NUMBER: 13 fun case_13() { - val __UNRESOLVED__> x: Int where __UNRESOLVED__: __UNRESOLVED__ - var __UNRESOLVED__> x: Int where __UNRESOLVED__: __UNRESOLVED__ + val __UNRESOLVED__> x: Int where __UNRESOLVED__: __UNRESOLVED__ + var __UNRESOLVED__> x: Int where __UNRESOLVED__: __UNRESOLVED__ } // TESTCASE NUMBER: 14