I don’t know what you try to achieve with this code. This does exactly the same thing as
fun CreateUserWrapper(id: String, vararg params: Any) {
CreateUser(id, params)
DisableNameDuplicateCheckingForUser(id)
}
Your macro code just adds some additional classes and function calls to the generated bytecode without any advantages.
The original problem is that CreateUser
is defined as something like this
fun CreateUser(id: String, arg1: A, arg2: B, ...) {}
and the wrapper only needs to know about the id. The rest is just supposed to be passed along. The reason you don’t want to use vararg
for this, is that this way you no longer have compile time type checking.