What is the simplest option to disable autobox for...
# compiler
t
What is the simplest option to disable autobox for value class?
Copy code
value class Age(value: Int)

val age = Age(42)
println(age) // AUTOBOX DISABLING REQUIRED
In
IrElementTransformer
I can receive
age
as
IrGetValue
. Which processing required after?
i
What's your use-case to disable auto-boxing? What are you trying to achieve?
t
What’s your use-case to disable auto-boxing? What are you trying to achieve?
It’s required for integration with external libraries. React in my case
Copy code
val delay = useDuration()

val extraDelay = useMemo(delay /* AUTOBOX NOT REQUIRED */) {
    delay + delay
}

// from React
external <T> fun useMemo(
    vararg dependencies: Any?,
    callback: () -> T,
): T