[FIR] builder: drop unused forcedElementSourceKind

There was only one usage by withDefaultSourceElementKind that was
dropped in the previous commit

^KT-63042
This commit is contained in:
Dmitrii Gridin
2023-11-21 15:21:13 +01:00
committed by Space Team
parent 6c1f5b7a74
commit 9d72c1c370
6 changed files with 10 additions and 30 deletions
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
@@ -31,7 +31,7 @@ abstract class AbstractLightTreeRawFirBuilder(
override fun LighterASTNode.toFirSourceElement(kind: KtFakeSourceElementKind?): KtLightSourceElement {
val startOffset = tree.getStartOffset(this)
val endOffset = tree.getEndOffset(this)
return toKtLightSourceElement(tree, kind ?: context.forcedElementSourceKind ?: KtRealSourceElementKind, startOffset, endOffset)
return toKtLightSourceElement(tree, kind ?: KtRealSourceElementKind, startOffset, endOffset)
}
override val LighterASTNode.elementType: IElementType
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
@@ -78,7 +78,7 @@ class LightTreeRawFirExpressionBuilder(
)
}
else -> buildErrorExpression(
converted?.source?.withForcedKindFrom(context) ?: expression?.toFirSourceElement(),
converted?.source?.realElement() ?: expression?.toFirSourceElement(),
if (expression == null) ConeSyntaxDiagnostic(errorReason)
else ConeSimpleDiagnostic(errorReason, DiagnosticKind.ExpressionExpected),
converted,