FIR: fix incorrect psi for named & spread arguments in FIR builder

This commit is contained in:
Ilya Kirillov
2020-05-13 18:48:57 +03:00
parent 6a4fa8de9d
commit 507fc34c22
@@ -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. * 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 val isSpread = getSpreadElement() != null
return when { return when {
name != null -> buildNamedArgumentExpression { name != null -> buildNamedArgumentExpression {
source = expression?.toFirSourceElement() source = (this@toFirExpression as? PsiElement)?.toFirSourceElement()
this.expression = firExpression this.expression = firExpression
this.isSpread = isSpread this.isSpread = isSpread
this.name = name this.name = name
} }
isSpread -> buildSpreadArgumentExpression { isSpread -> buildSpreadArgumentExpression {
source = expression?.toFirSourceElement() source = (this@toFirExpression as? PsiElement)?.toFirSourceElement()
this.expression = firExpression this.expression = firExpression
} }
else -> firExpression else -> firExpression