Commit cd37c10b authored by Akshay S Dinesh's avatar Akshay S Dinesh
Browse files

Fix object reference showing up in last sync status

The vararg parameter wraps whatever it receives in an array. So, when we
pass it further to another method that takes vararg, we have to pass it
decomposed.

Similarly, mutableListOf takes varargs
parent b83e07dd
......@@ -21,7 +21,7 @@ class IdResourceResolver @JvmOverloads internal constructor(
@StringRes private val resId: Int,
vararg args: Any = arrayOf()
): IResourceResolver {
private val formatArgs: MutableList<Any> = mutableListOf(args)
private val formatArgs: MutableList<Any> = args.toMutableList()
fun add(any: Any) = this@IdResourceResolver.formatArgs.add(any)
operator fun Any.unaryPlus() = add(this)
......@@ -47,6 +47,6 @@ fun idResRes(
@StringRes resId: Int,
vararg args: Any = arrayOf(),
cb: IdResourceResolver.() -> Unit = {}
) = IdResourceResolver(resId, args).apply(cb)
) = IdResourceResolver(resId, *args).apply(cb)
fun functionRes(cb: Context.() -> String) = FunctionResourceResolver(cb)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment