diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/expressions/impl/FirErrorExpressionImpl.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/expressions/impl/FirErrorExpressionImpl.kt index 9c024c82304..2777257aa5a 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/expressions/impl/FirErrorExpressionImpl.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/expressions/impl/FirErrorExpressionImpl.kt @@ -34,7 +34,8 @@ internal class FirErrorExpressionImpl( override var nonExpressionElement: FirElement?, ) : FirErrorExpression() { @OptIn(UnresolvedExpressionTypeAccess::class) - override var coneTypeOrNull: ConeKotlinType? = ConeErrorType(ConeStubDiagnostic(diagnostic)) + override val coneTypeOrNull: ConeKotlinType? + get() = expression?.coneTypeOrNull ?: ConeErrorType(ConeStubDiagnostic(diagnostic)) override fun acceptChildren(visitor: FirVisitor, data: D) { annotations.forEach { it.accept(visitor, data) } @@ -54,9 +55,7 @@ internal class FirErrorExpressionImpl( return this } - override fun replaceConeTypeOrNull(newConeTypeOrNull: ConeKotlinType?) { - coneTypeOrNull = newConeTypeOrNull - } + override fun replaceConeTypeOrNull(newConeTypeOrNull: ConeKotlinType?) {} override fun replaceAnnotations(newAnnotations: List) { annotations = newAnnotations.toMutableOrEmpty() diff --git a/compiler/fir/tree/tree-generator/src/org/jetbrains/kotlin/fir/tree/generator/ImplementationConfigurator.kt b/compiler/fir/tree/tree-generator/src/org/jetbrains/kotlin/fir/tree/generator/ImplementationConfigurator.kt index d69840db7aa..f0ebb4e784d 100644 --- a/compiler/fir/tree/tree-generator/src/org/jetbrains/kotlin/fir/tree/generator/ImplementationConfigurator.kt +++ b/compiler/fir/tree/tree-generator/src/org/jetbrains/kotlin/fir/tree/generator/ImplementationConfigurator.kt @@ -518,7 +518,7 @@ object ImplementationConfigurator : AbstractFirTreeImplementationConfigurator() } impl(errorExpression) { - default("coneTypeOrNull", "ConeErrorType(ConeStubDiagnostic(diagnostic))") + default("coneTypeOrNull", "expression?.coneTypeOrNull ?: ConeErrorType(ConeStubDiagnostic(diagnostic))", withGetter = true) additionalImports(coneErrorTypeType, coneStubDiagnosticType) } diff --git a/compiler/testData/diagnostics/tests/labledLambda.fir.kt b/compiler/testData/diagnostics/tests/labledLambda.fir.kt index ebf11c7641d..785742293cc 100644 --- a/compiler/testData/diagnostics/tests/labledLambda.fir.kt +++ b/compiler/testData/diagnostics/tests/labledLambda.fir.kt @@ -1,5 +1,5 @@ // ISSUE: KT-65337 inline fun bar(s: () -> Unit) { - (_@ s)() + (_@ s)() } diff --git a/compiler/testData/diagnostics/tests/modifiers/const/arrayInAnnotationArgumentType.fir.kt b/compiler/testData/diagnostics/tests/modifiers/const/arrayInAnnotationArgumentType.fir.kt index 328e56c4402..c3c3b9916a4 100644 --- a/compiler/testData/diagnostics/tests/modifiers/const/arrayInAnnotationArgumentType.fir.kt +++ b/compiler/testData/diagnostics/tests/modifiers/const/arrayInAnnotationArgumentType.fir.kt @@ -1,2 +1,2 @@ -annotation class A(val a: IntArray = arrayOf(1)) +annotation class A(val a: IntArray = arrayOf(1)) annotation class B(val a: IntArray = intArrayOf(1)) diff --git a/compiler/testData/diagnostics/tests/qualifiedExpression/nullCalleeExpression.fir.kt b/compiler/testData/diagnostics/tests/qualifiedExpression/nullCalleeExpression.fir.kt index 0098c771ad6..5af3792a14a 100644 --- a/compiler/testData/diagnostics/tests/qualifiedExpression/nullCalleeExpression.fir.kt +++ b/compiler/testData/diagnostics/tests/qualifiedExpression/nullCalleeExpression.fir.kt @@ -1,3 +1,3 @@ // NI_EXPECTED_FILE -val unwrapped = some.<cabc$Wrapper<out Any>::unwrap +val unwrapped = some.<cabc$Wrapper<out Any>::unwrap diff --git a/compiler/testData/diagnostics/tests/regressions/TypeMismatchOnUnaryOperations.fir.kt b/compiler/testData/diagnostics/tests/regressions/TypeMismatchOnUnaryOperations.fir.kt index c85184cebf4..d3c08fdac3c 100644 --- a/compiler/testData/diagnostics/tests/regressions/TypeMismatchOnUnaryOperations.fir.kt +++ b/compiler/testData/diagnostics/tests/regressions/TypeMismatchOnUnaryOperations.fir.kt @@ -11,7 +11,7 @@ fun main() { val h1 : String = --v; val i : String = !true; val j : String = foo@ true; - val k : String = foo@ bar@ true; + val k : String = foo@ bar@ true; val l : String = -1; val m : String = +1; } diff --git a/compiler/testData/diagnostics/tests/regressions/resolveCollectionLiteralInsideLambda.fir.kt b/compiler/testData/diagnostics/tests/regressions/resolveCollectionLiteralInsideLambda.fir.kt index 31b24634a91..199655db5a7 100644 --- a/compiler/testData/diagnostics/tests/regressions/resolveCollectionLiteralInsideLambda.fir.kt +++ b/compiler/testData/diagnostics/tests/regressions/resolveCollectionLiteralInsideLambda.fir.kt @@ -4,4 +4,4 @@ fun foo(l: () -> Unit) {} fun bar(l: () -> String) {} val a = foo { [] } -val b = bar { [] } +val b = bar { [] } diff --git a/generators/tree-generator-common/src/org/jetbrains/kotlin/generators/tree/config/AbstractImplementationConfigurator.kt b/generators/tree-generator-common/src/org/jetbrains/kotlin/generators/tree/config/AbstractImplementationConfigurator.kt index 527cc5c5681..1494e2e1075 100644 --- a/generators/tree-generator-common/src/org/jetbrains/kotlin/generators/tree/config/AbstractImplementationConfigurator.kt +++ b/generators/tree-generator-common/src/org/jetbrains/kotlin/generators/tree/config/AbstractImplementationConfigurator.kt @@ -186,9 +186,10 @@ abstract class AbstractImplementationConfigurator