Fix argument mapping for lambda arguments and default arguments
Maybe for other elements ValueArgument itself used as SourceElement
This commit is contained in:
+4
-2
@@ -167,15 +167,17 @@ internal class FirWrapperResolvedCall(val firSimpleWrapperCall: FirSimpleWrapper
|
||||
val firArguments = firCall.withFir { it.argumentMapping } ?: context.implementationPostponed()
|
||||
val argumentExpression = valueArgument.getArgumentExpression() ?: context.implementationPostponed()
|
||||
|
||||
fun FirExpression.isMyArgument() = realPsi === valueArgument || realPsi === argumentExpression
|
||||
|
||||
var targetFirParameter: FirValueParameter? = null
|
||||
outer@ for ((firExpression, firValueParameter) in firArguments.entries) {
|
||||
if (firExpression is FirVarargArgumentsExpression) {
|
||||
for (subExpression in firExpression.arguments)
|
||||
if (subExpression.realPsi === argumentExpression) {
|
||||
if (subExpression.isMyArgument()) {
|
||||
targetFirParameter = firValueParameter
|
||||
break@outer
|
||||
}
|
||||
} else if (firExpression.realPsi === argumentExpression) {
|
||||
} else if (firExpression.isMyArgument()) {
|
||||
targetFirParameter = firValueParameter
|
||||
break@outer
|
||||
}
|
||||
|
||||
-1
@@ -1,4 +1,3 @@
|
||||
// IGNORE_FE10_BINDING_BY_FIR
|
||||
fun test() {
|
||||
class Test{
|
||||
operator fun contains(fn: () -> Boolean) : Boolean = true
|
||||
|
||||
Vendored
-1
@@ -1,4 +1,3 @@
|
||||
// IGNORE_FE10_BINDING_BY_FIR
|
||||
fun test() {
|
||||
class Test{
|
||||
operator fun contains(fn: () -> Boolean) : Boolean = true
|
||||
|
||||
-1
@@ -1,4 +1,3 @@
|
||||
// IGNORE_FE10_BINDING_BY_FIR
|
||||
fun test() {
|
||||
class Test{
|
||||
operator fun contains(fn: () -> Boolean) : Boolean = true
|
||||
|
||||
-1
@@ -1,4 +1,3 @@
|
||||
// IGNORE_FE10_BINDING_BY_FIR
|
||||
fun test() {
|
||||
class Test{
|
||||
operator fun contains(fn: () -> Boolean) : Boolean = true
|
||||
|
||||
-1
@@ -1,4 +1,3 @@
|
||||
// IGNORE_FE10_BINDING_BY_FIR
|
||||
fun test() {
|
||||
class Test{
|
||||
operator fun contains(fn: () -> Boolean) : Boolean = true
|
||||
|
||||
-1
@@ -1,4 +1,3 @@
|
||||
// IGNORE_FE10_BINDING_BY_FIR
|
||||
fun test() {
|
||||
class Test{
|
||||
operator fun contains(fn: () -> Boolean) : Boolean = true
|
||||
|
||||
Vendored
-1
@@ -1,4 +1,3 @@
|
||||
// IGNORE_FE10_BINDING_BY_FIR
|
||||
fun <T> doSomething(a: T) {}
|
||||
|
||||
fun test() {
|
||||
|
||||
-1
@@ -1,4 +1,3 @@
|
||||
// IGNORE_FE10_BINDING_BY_FIR
|
||||
fun <T> doSomething(a: T) {}
|
||||
|
||||
fun test() {
|
||||
|
||||
-2
@@ -1,7 +1,5 @@
|
||||
// IS_APPLICABLE: false
|
||||
// ERROR: 'operator' modifier is inapplicable on this function: must have a single value parameter
|
||||
// IGNORE_FE10_BINDING_BY_FIR
|
||||
|
||||
fun test() {
|
||||
class Test{
|
||||
operator fun contains(a: Int=1, b: Int=2) : Boolean = true
|
||||
|
||||
-1
@@ -1,6 +1,5 @@
|
||||
// IS_APPLICABLE: false
|
||||
// ERROR: 'operator' modifier is inapplicable on this function: must have a single value parameter
|
||||
// IGNORE_FE10_BINDING_BY_FIR
|
||||
fun test() {
|
||||
class Test{
|
||||
operator fun contains(vararg b: Int, c: Int = 0): Boolean = true
|
||||
|
||||
Reference in New Issue
Block a user