From 507fc34c22a6f406f7d7500af7e465b64e579015 Mon Sep 17 00:00:00 2001 From: Ilya Kirillov Date: Wed, 13 May 2020 18:48:57 +0300 Subject: [PATCH] FIR: fix incorrect psi for named & spread arguments in FIR builder --- .../src/org/jetbrains/kotlin/fir/builder/RawFirBuilder.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/compiler/fir/raw-fir/psi2fir/src/org/jetbrains/kotlin/fir/builder/RawFirBuilder.kt b/compiler/fir/raw-fir/psi2fir/src/org/jetbrains/kotlin/fir/builder/RawFirBuilder.kt index f8114bb3002..24644767f35 100644 --- a/compiler/fir/raw-fir/psi2fir/src/org/jetbrains/kotlin/fir/builder/RawFirBuilder.kt +++ b/compiler/fir/raw-fir/psi2fir/src/org/jetbrains/kotlin/fir/builder/RawFirBuilder.kt @@ -1,5 +1,5 @@ /* - * Copyright 2000-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Copyright 2010-2020 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. */ @@ -237,13 +237,13 @@ class RawFirBuilder( val isSpread = getSpreadElement() != null return when { name != null -> buildNamedArgumentExpression { - source = expression?.toFirSourceElement() + source = (this@toFirExpression as? PsiElement)?.toFirSourceElement() this.expression = firExpression this.isSpread = isSpread this.name = name } isSpread -> buildSpreadArgumentExpression { - source = expression?.toFirSourceElement() + source = (this@toFirExpression as? PsiElement)?.toFirSourceElement() this.expression = firExpression } else -> firExpression