HL API: update resolve call tests
This commit is contained in:
committed by
teamcityserver
parent
44812ae45a
commit
d7f1353d3d
+3
-1
@@ -1 +1,3 @@
|
|||||||
KtFunctionCall: targetFunction = /function(a: kotlin.Int): kotlin.Unit
|
KtFunctionCall:
|
||||||
|
argumentMapping = { 1 -> (a: kotlin.Int) }
|
||||||
|
targetFunction = /function(a: kotlin.Int): kotlin.Unit
|
||||||
+3
-1
@@ -1 +1,3 @@
|
|||||||
KtFunctionCall: targetFunction = /function(<receiver>: kotlin.String, a: kotlin.Int): kotlin.Unit
|
KtFunctionCall:
|
||||||
|
argumentMapping = { 1 -> (a: kotlin.Int) }
|
||||||
|
targetFunction = /function(<receiver>: kotlin.String, a: kotlin.Int): kotlin.Unit
|
||||||
Vendored
+3
-1
@@ -1 +1,3 @@
|
|||||||
KtFunctionCall: targetFunction = /function(<receiver>: kotlin.String, a: kotlin.Int): kotlin.Unit
|
KtFunctionCall:
|
||||||
|
argumentMapping = { 1 -> (a: kotlin.Int) }
|
||||||
|
targetFunction = /function(<receiver>: kotlin.String, a: kotlin.Int): kotlin.Unit
|
||||||
+3
-1
@@ -1 +1,3 @@
|
|||||||
KtFunctionCall: targetFunction = <constructor>(): A
|
KtFunctionCall:
|
||||||
|
argumentMapping = { }
|
||||||
|
targetFunction = <constructor>(): A
|
||||||
+3
-1
@@ -1 +1,3 @@
|
|||||||
KtFunctionCall: targetFunction = <constructor>(): A
|
KtFunctionCall:
|
||||||
|
argumentMapping = { }
|
||||||
|
targetFunction = <constructor>(): A
|
||||||
+3
-1
@@ -1 +1,3 @@
|
|||||||
KtFunctionCall: targetFunction = /JavaClass.javaMethod(): kotlin.Unit
|
KtFunctionCall:
|
||||||
|
argumentMapping = { }
|
||||||
|
targetFunction = /JavaClass.javaMethod(): kotlin.Unit
|
||||||
Vendored
+3
-1
@@ -1 +1,3 @@
|
|||||||
KtFunctionCall: targetFunction = /to(<receiver>: A, other: B): A
|
KtFunctionCall:
|
||||||
|
argumentMapping = { }
|
||||||
|
targetFunction = /to(<receiver>: A, other: B): A
|
||||||
Vendored
+3
-1
@@ -1 +1,3 @@
|
|||||||
KtFunctionCall: targetFunction = ERR<Too many arguments for public final fun /foo(): R|kotlin/Unit|, [/foo(): kotlin.Unit]>
|
KtFunctionCall:
|
||||||
|
argumentMapping = { }
|
||||||
|
targetFunction = ERR<Too many arguments for public final fun /foo(): R|kotlin/Unit|, [/foo(): kotlin.Unit]>
|
||||||
+3
-1
@@ -1 +1,3 @@
|
|||||||
KtFunctionalTypeVariableCall: target = x: kotlin.Function1<kotlin.Int, kotlin.String>, targetFunction = kotlin/Function1.invoke(p1: kotlin.Int): kotlin.String
|
KtFunctionalTypeVariableCall:
|
||||||
|
target = x: kotlin.Function1<kotlin.Int, kotlin.String>
|
||||||
|
targetFunction = kotlin/Function1.invoke(p1: kotlin.Int): kotlin.String
|
||||||
+3
-1
@@ -1 +1,3 @@
|
|||||||
KtFunctionCall: targetFunction = /invoke(<receiver>: kotlin.Int): kotlin.String
|
KtFunctionCall:
|
||||||
|
argumentMapping = { }
|
||||||
|
targetFunction = /invoke(<receiver>: kotlin.Int): kotlin.String
|
||||||
+4
-2
@@ -69,15 +69,17 @@ private fun KtCall.stringRepresentation(): String {
|
|||||||
is KtSuccessCallTarget -> symbol.stringValue()
|
is KtSuccessCallTarget -> symbol.stringValue()
|
||||||
is KtErrorCallTarget -> "ERR<${this.diagnostic.defaultMessage}, [${candidates.joinToString { it.stringValue() }}]>"
|
is KtErrorCallTarget -> "ERR<${this.diagnostic.defaultMessage}, [${candidates.joinToString { it.stringValue() }}]>"
|
||||||
is Boolean -> toString()
|
is Boolean -> toString()
|
||||||
|
is Map<*, *> -> entries.joinToString(prefix = "{ ", postfix = " }") { (k, v) -> "${k?.stringValue()} -> (${v?.stringValue()})" }
|
||||||
|
is KtValueArgument -> this.text
|
||||||
else -> error("unexpected parameter type ${this::class}")
|
else -> error("unexpected parameter type ${this::class}")
|
||||||
}
|
}
|
||||||
|
|
||||||
val callInfoClass = this::class
|
val callInfoClass = this::class
|
||||||
return buildString {
|
return buildString {
|
||||||
append(callInfoClass.simpleName!!)
|
append(callInfoClass.simpleName!!)
|
||||||
append(": ")
|
append(":\n")
|
||||||
val propertyByName = callInfoClass.memberProperties.associateBy(KProperty1<*, *>::name)
|
val propertyByName = callInfoClass.memberProperties.associateBy(KProperty1<*, *>::name)
|
||||||
callInfoClass.primaryConstructor!!.parameters.joinTo(this) { parameter ->
|
callInfoClass.primaryConstructor!!.parameters.joinTo(this, separator = "\n") { parameter ->
|
||||||
val value = propertyByName[parameter.name]!!.javaGetter!!(this@stringRepresentation)?.stringValue()
|
val value = propertyByName[parameter.name]!!.javaGetter!!(this@stringRepresentation)?.stringValue()
|
||||||
"${parameter.name!!} = $value"
|
"${parameter.name!!} = $value"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user