AA FIR: build argument mapping for SAM conversion node
^KT-64910 fixed
This commit is contained in:
+43
@@ -0,0 +1,43 @@
|
||||
KtSuccessCallInfo:
|
||||
call = KtSimpleFunctionCall:
|
||||
isImplicitInvoke = false
|
||||
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
|
||||
dispatchReceiver = KtExplicitReceiverValue:
|
||||
expression = handler
|
||||
isSafeNavigation = false
|
||||
type = test.pkg.MyHandler
|
||||
extensionReceiver = null
|
||||
signature = KtFunctionLikeSignature:
|
||||
receiverType = null
|
||||
returnType = kotlin.Unit
|
||||
symbol = test/pkg/MyHandler.stash(<dispatch receiver>: test.pkg.MyHandler, actor: test.pkg.MyInterface!, actors: (kotlin.collections.MutableList<test.pkg.MyInterface!>..kotlin.collections.List<test.pkg.MyInterface!>?)): kotlin.Unit
|
||||
valueParameters = [
|
||||
KtVariableLikeSignature:
|
||||
name = actor
|
||||
receiverType = null
|
||||
returnType = test.pkg.MyInterface!
|
||||
symbol = actor: test.pkg.MyInterface!
|
||||
callableIdIfNonLocal = null,
|
||||
KtVariableLikeSignature:
|
||||
name = actors
|
||||
receiverType = null
|
||||
returnType = (kotlin.collections.MutableList<test.pkg.MyInterface!>..kotlin.collections.List<test.pkg.MyInterface!>?)
|
||||
symbol = actors: (kotlin.collections.MutableList<test.pkg.MyInterface!>..kotlin.collections.List<test.pkg.MyInterface!>?)
|
||||
callableIdIfNonLocal = null
|
||||
]
|
||||
callableIdIfNonLocal = test/pkg/MyHandler.stash
|
||||
typeArgumentsMapping = {}
|
||||
argumentMapping = {
|
||||
lambda -> (KtVariableLikeSignature:
|
||||
name = actor
|
||||
receiverType = null
|
||||
returnType = test.pkg.MyInterface!
|
||||
symbol = actor: test.pkg.MyInterface!
|
||||
callableIdIfNonLocal = null),
|
||||
list -> (KtVariableLikeSignature:
|
||||
name = actors
|
||||
receiverType = null
|
||||
returnType = (kotlin.collections.MutableList<test.pkg.MyInterface!>..kotlin.collections.List<test.pkg.MyInterface!>?)
|
||||
symbol = actors: (kotlin.collections.MutableList<test.pkg.MyInterface!>..kotlin.collections.List<test.pkg.MyInterface!>?)
|
||||
callableIdIfNonLocal = null)
|
||||
}
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
// WITH_STDLIB
|
||||
|
||||
// FILE: MyInterface.java
|
||||
|
||||
package test.pkg;
|
||||
|
||||
interface MyInterface {
|
||||
void act();
|
||||
}
|
||||
|
||||
// FILE: MyHandler.java
|
||||
|
||||
package test.pkg;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class MyHandler {
|
||||
public void stash(MyInterface actor, List<MyInterface> actors) {
|
||||
actors.add(actor);
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: main.kt
|
||||
|
||||
package test.pkg
|
||||
|
||||
fun test(handler: MyHandler, list: List<MyInterface>) {
|
||||
val lambda = { println("hello") }
|
||||
<expr>handler.stash(lambda, list)</expr>
|
||||
}
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
KtSuccessCallInfo:
|
||||
call = KtSimpleFunctionCall:
|
||||
isImplicitInvoke = false
|
||||
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
|
||||
dispatchReceiver = KtExplicitReceiverValue:
|
||||
expression = handler
|
||||
isSafeNavigation = false
|
||||
type = test.pkg.MyHandler
|
||||
extensionReceiver = null
|
||||
signature = KtFunctionLikeSignature:
|
||||
receiverType = null
|
||||
returnType = kotlin.Unit
|
||||
symbol = test/pkg/MyHandler.stash(<dispatch receiver>: test.pkg.MyHandler, actor: test.pkg.MyInterface!, actors: ft<kotlin.collections.MutableList<test.pkg.MyInterface!>, kotlin.collections.List<test.pkg.MyInterface!>?>): kotlin.Unit
|
||||
valueParameters = [
|
||||
KtVariableLikeSignature:
|
||||
name = actor
|
||||
receiverType = null
|
||||
returnType = test.pkg.MyInterface!
|
||||
symbol = actor: test.pkg.MyInterface!
|
||||
callableIdIfNonLocal = null,
|
||||
KtVariableLikeSignature:
|
||||
name = actors
|
||||
receiverType = null
|
||||
returnType = ft<kotlin.collections.MutableList<test.pkg.MyInterface!>, kotlin.collections.List<test.pkg.MyInterface!>?>
|
||||
symbol = actors: ft<kotlin.collections.MutableList<test.pkg.MyInterface!>, kotlin.collections.List<test.pkg.MyInterface!>?>
|
||||
callableIdIfNonLocal = null
|
||||
]
|
||||
callableIdIfNonLocal = test/pkg/MyHandler.stash
|
||||
typeArgumentsMapping = {}
|
||||
argumentMapping = {
|
||||
lambda -> (KtVariableLikeSignature:
|
||||
name = actor
|
||||
receiverType = null
|
||||
returnType = test.pkg.MyInterface!
|
||||
symbol = actor: test.pkg.MyInterface!
|
||||
callableIdIfNonLocal = null),
|
||||
list -> (KtVariableLikeSignature:
|
||||
name = actors
|
||||
receiverType = null
|
||||
returnType = ft<kotlin.collections.MutableList<test.pkg.MyInterface!>, kotlin.collections.List<test.pkg.MyInterface!>?>
|
||||
symbol = actors: ft<kotlin.collections.MutableList<test.pkg.MyInterface!>, kotlin.collections.List<test.pkg.MyInterface!>?>
|
||||
callableIdIfNonLocal = null)
|
||||
}
|
||||
Vendored
+33
@@ -0,0 +1,33 @@
|
||||
// WITH_STDLIB
|
||||
|
||||
// FILE: MyInterface.java
|
||||
|
||||
package test.pkg;
|
||||
|
||||
interface MyInterface {
|
||||
void act();
|
||||
}
|
||||
|
||||
// FILE: MyHandler.java
|
||||
|
||||
package test.pkg;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class MyHandler {
|
||||
public void act(MyInterface actor) {
|
||||
if (actor != null) {
|
||||
actor.act();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: main.kt
|
||||
|
||||
package test.pkg
|
||||
|
||||
fun callback() {}
|
||||
|
||||
fun test(handler: MyHandler, list: List<MyInterface>) {
|
||||
<expr>handler.act(::callback)</expr>
|
||||
}
|
||||
Vendored
+31
@@ -0,0 +1,31 @@
|
||||
KtSuccessCallInfo:
|
||||
call = KtSimpleFunctionCall:
|
||||
isImplicitInvoke = false
|
||||
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
|
||||
dispatchReceiver = KtExplicitReceiverValue:
|
||||
expression = handler
|
||||
isSafeNavigation = false
|
||||
type = test.pkg.MyHandler
|
||||
extensionReceiver = null
|
||||
signature = KtFunctionLikeSignature:
|
||||
receiverType = null
|
||||
returnType = kotlin.Unit
|
||||
symbol = test/pkg/MyHandler.act(<dispatch receiver>: test.pkg.MyHandler, actor: test.pkg.MyInterface!): kotlin.Unit
|
||||
valueParameters = [
|
||||
KtVariableLikeSignature:
|
||||
name = actor
|
||||
receiverType = null
|
||||
returnType = test.pkg.MyInterface!
|
||||
symbol = actor: test.pkg.MyInterface!
|
||||
callableIdIfNonLocal = null
|
||||
]
|
||||
callableIdIfNonLocal = test/pkg/MyHandler.act
|
||||
typeArgumentsMapping = {}
|
||||
argumentMapping = {
|
||||
::callback -> (KtVariableLikeSignature:
|
||||
name = actor
|
||||
receiverType = null
|
||||
returnType = test.pkg.MyInterface!
|
||||
symbol = actor: test.pkg.MyInterface!
|
||||
callableIdIfNonLocal = null)
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
class Test {
|
||||
fun interface Foo {
|
||||
fun foo()
|
||||
}
|
||||
|
||||
fun uiMethod() {}
|
||||
|
||||
fun test(foo: Foo) {}
|
||||
|
||||
fun testLambda() {
|
||||
<expr>test { uiMethod() }</expr>
|
||||
}
|
||||
}
|
||||
+54
@@ -0,0 +1,54 @@
|
||||
KtSuccessCallInfo:
|
||||
call = KtSimpleFunctionCall:
|
||||
isImplicitInvoke = false
|
||||
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
|
||||
dispatchReceiver = KtImplicitReceiverValue:
|
||||
symbol = KtNamedClassOrObjectSymbol:
|
||||
annotationsList: []
|
||||
classIdIfNonLocal: Test
|
||||
classKind: CLASS
|
||||
companionObject: null
|
||||
contextReceivers: []
|
||||
isActual: false
|
||||
isData: false
|
||||
isExpect: false
|
||||
isExternal: false
|
||||
isFun: false
|
||||
isInline: false
|
||||
isInner: false
|
||||
modality: FINAL
|
||||
name: Test
|
||||
origin: SOURCE
|
||||
superTypes: [
|
||||
KtUsualClassType:
|
||||
annotationsList: []
|
||||
ownTypeArguments: []
|
||||
type: kotlin/Any
|
||||
]
|
||||
symbolKind: TOP_LEVEL
|
||||
typeParameters: []
|
||||
visibility: Public
|
||||
type = Test
|
||||
extensionReceiver = null
|
||||
signature = KtFunctionLikeSignature:
|
||||
receiverType = null
|
||||
returnType = kotlin.Unit
|
||||
symbol = /Test.test(<dispatch receiver>: Test, foo: Test.Foo): kotlin.Unit
|
||||
valueParameters = [
|
||||
KtVariableLikeSignature:
|
||||
name = foo
|
||||
receiverType = null
|
||||
returnType = Test.Foo
|
||||
symbol = foo: Test.Foo
|
||||
callableIdIfNonLocal = null
|
||||
]
|
||||
callableIdIfNonLocal = /Test.test
|
||||
typeArgumentsMapping = {}
|
||||
argumentMapping = {
|
||||
{ uiMethod() } -> (KtVariableLikeSignature:
|
||||
name = foo
|
||||
receiverType = null
|
||||
returnType = Test.Foo
|
||||
symbol = foo: Test.Foo
|
||||
callableIdIfNonLocal = null)
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
class Test {
|
||||
fun interface Foo {
|
||||
fun foo()
|
||||
}
|
||||
|
||||
fun uiMethod() {}
|
||||
|
||||
fun test(foo: Foo) {}
|
||||
|
||||
fun testMethodRef() {
|
||||
<expr>test(this::uiMethod)</expr>
|
||||
}
|
||||
}
|
||||
+54
@@ -0,0 +1,54 @@
|
||||
KtSuccessCallInfo:
|
||||
call = KtSimpleFunctionCall:
|
||||
isImplicitInvoke = false
|
||||
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
|
||||
dispatchReceiver = KtImplicitReceiverValue:
|
||||
symbol = KtNamedClassOrObjectSymbol:
|
||||
annotationsList: []
|
||||
classIdIfNonLocal: Test
|
||||
classKind: CLASS
|
||||
companionObject: null
|
||||
contextReceivers: []
|
||||
isActual: false
|
||||
isData: false
|
||||
isExpect: false
|
||||
isExternal: false
|
||||
isFun: false
|
||||
isInline: false
|
||||
isInner: false
|
||||
modality: FINAL
|
||||
name: Test
|
||||
origin: SOURCE
|
||||
superTypes: [
|
||||
KtUsualClassType:
|
||||
annotationsList: []
|
||||
ownTypeArguments: []
|
||||
type: kotlin/Any
|
||||
]
|
||||
symbolKind: TOP_LEVEL
|
||||
typeParameters: []
|
||||
visibility: Public
|
||||
type = Test
|
||||
extensionReceiver = null
|
||||
signature = KtFunctionLikeSignature:
|
||||
receiverType = null
|
||||
returnType = kotlin.Unit
|
||||
symbol = /Test.test(<dispatch receiver>: Test, foo: Test.Foo): kotlin.Unit
|
||||
valueParameters = [
|
||||
KtVariableLikeSignature:
|
||||
name = foo
|
||||
receiverType = null
|
||||
returnType = Test.Foo
|
||||
symbol = foo: Test.Foo
|
||||
callableIdIfNonLocal = null
|
||||
]
|
||||
callableIdIfNonLocal = /Test.test
|
||||
typeArgumentsMapping = {}
|
||||
argumentMapping = {
|
||||
this::uiMethod -> (KtVariableLikeSignature:
|
||||
name = foo
|
||||
receiverType = null
|
||||
returnType = Test.Foo
|
||||
symbol = foo: Test.Foo
|
||||
callableIdIfNonLocal = null)
|
||||
}
|
||||
Reference in New Issue
Block a user