Skip to content

Commit c0578ab

Browse files
committed
Use vararg argument in string only methods
1 parent f8e42c3 commit c0578ab

File tree

6 files changed

+12
-12
lines changed

6 files changed

+12
-12
lines changed

kt/api-generator/src/main/kotlin/godot/codegen/generation/rule/MethodRule.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ class StringOnlyRule : GodotApiRule<EnrichedClassTask>(), BaseMethodeRule {
287287
append(".asCachedNodePath()")
288288
}
289289
}
290-
if (method.isVararg && isNotEmpty()) append("")
290+
if (method.isVararg && isNotEmpty()) append("*args")
291291
}
292292

293293
addStatement("return·${method.name}($arguments)")

kt/godot-library/godot-api-library/src/main/kotlin/godot/api/ClassDB.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,7 @@ public object ClassDB : Object() {
576576
`class`: String,
577577
method: String,
578578
vararg args: Any?,
579-
): Any? = classCallStatic(`class`.asCachedStringName(), method.asCachedStringName(), )
579+
): Any? = classCallStatic(`class`.asCachedStringName(), method.asCachedStringName(), *args)
580580

581581
/**
582582
* Returns an array with the names all the integer constants of [class] or its ancestry.

kt/godot-library/godot-api-library/src/main/kotlin/godot/api/Node.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2685,7 +2685,7 @@ public open class Node : Object() {
26852685
* (`get_multiplayer().peer.get_connection_status() == CONNECTION_CONNECTED`).
26862686
*/
26872687
public final fun rpc(method: String, vararg args: Any?): Error =
2688-
rpc(method.asCachedStringName(), )
2688+
rpc(method.asCachedStringName(), *args)
26892689

26902690
/**
26912691
* Sends a [rpc] to a specific peer identified by [peerId] (see [MultiplayerPeer.setTargetPeer]).
@@ -2699,7 +2699,7 @@ public open class Node : Object() {
26992699
peerId: Long,
27002700
method: String,
27012701
vararg args: Any?,
2702-
): Error = rpcId(peerId, method.asCachedStringName(), )
2702+
): Error = rpcId(peerId, method.asCachedStringName(), *args)
27032703

27042704
/**
27052705
* This function is similar to [Object.callDeferred] except that the call will take place when the
@@ -2709,7 +2709,7 @@ public open class Node : Object() {
27092709
* called.
27102710
*/
27112711
public final fun callDeferredThreadGroup(method: String, vararg args: Any?): Any? =
2712-
callDeferredThreadGroup(method.asCachedStringName(), )
2712+
callDeferredThreadGroup(method.asCachedStringName(), *args)
27132713

27142714
/**
27152715
* Similar to [callDeferredThreadGroup], but for setting properties.
@@ -2723,7 +2723,7 @@ public open class Node : Object() {
27232723
* the call will become deferred. Otherwise, the call will go through directly.
27242724
*/
27252725
public final fun callThreadSafe(method: String, vararg args: Any?): Any? =
2726-
callThreadSafe(method.asCachedStringName(), )
2726+
callThreadSafe(method.asCachedStringName(), *args)
27272727

27282728
/**
27292729
* Similar to [callThreadSafe], but for setting properties.

kt/godot-library/godot-api-library/src/main/kotlin/godot/api/SceneTree.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -763,7 +763,7 @@ public open class SceneTree : MainLoop() {
763763
group: String,
764764
method: String,
765765
vararg args: Any?,
766-
) = callGroupFlags(flags, group.asCachedStringName(), method.asCachedStringName(), )
766+
) = callGroupFlags(flags, group.asCachedStringName(), method.asCachedStringName(), *args)
767767

768768
/**
769769
* Calls [Object.notification] with the given [notification] to all nodes inside this tree added
@@ -808,7 +808,7 @@ public open class SceneTree : MainLoop() {
808808
group: String,
809809
method: String,
810810
vararg args: Any?,
811-
) = callGroup(group.asCachedStringName(), method.asCachedStringName(), )
811+
) = callGroup(group.asCachedStringName(), method.asCachedStringName(), *args)
812812

813813
/**
814814
* Calls [Object.notification] with the given [notification] to all nodes inside this tree added

kt/godot-library/godot-api-library/src/main/kotlin/godot/api/TreeItem.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1216,7 +1216,7 @@ public open class TreeItem internal constructor() : Object() {
12161216
* comma separated list.
12171217
*/
12181218
public final fun callRecursive(method: String, vararg args: Any?) =
1219-
callRecursive(method.asCachedStringName(), )
1219+
callRecursive(method.asCachedStringName(), *args)
12201220

12211221
public enum class TreeCellMode(
12221222
id: Long,

kt/godot-library/godot-core-library/src/main/kotlin/gen/godot/api/Object.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1399,7 +1399,7 @@ public open class Object : KtObject() {
13991399
* each call.
14001400
*/
14011401
public final fun emitSignal(signal: String, vararg args: Any?): Error =
1402-
emitSignal(signal.asCachedStringName(), )
1402+
emitSignal(signal.asCachedStringName(), *args)
14031403

14041404
/**
14051405
* Calls the [method] on the object and returns the result. This method supports a variable number
@@ -1422,7 +1422,7 @@ public open class Object : KtObject() {
14221422
* each call.
14231423
*/
14241424
public final fun call(method: String, vararg args: Any?): Any? =
1425-
call(method.asCachedStringName(), )
1425+
call(method.asCachedStringName(), *args)
14261426

14271427
/**
14281428
* Calls the [method] on the object during idle time. Always returns `null`, **not** the method's
@@ -1469,7 +1469,7 @@ public open class Object : KtObject() {
14691469
* ```
14701470
*/
14711471
public final fun callDeferred(method: String, vararg args: Any?): Any? =
1472-
callDeferred(method.asCachedStringName(), )
1472+
callDeferred(method.asCachedStringName(), *args)
14731473

14741474
/**
14751475
* Assigns [value] to the given [property], at the end of the current frame. This is equivalent to

0 commit comments

Comments
 (0)