https://kotlinlang.org logo
#getting-started
Title
# getting-started
t

Travis Griggs

10/12/2023, 8:40 PM
The Kotlin compiler is complaining about this function signature:
Copy code
fun snapDelta(delta: Duration, pixelSize: Duration, snapAnchors:SortedSet<Duration>, vararg targets: Duration): Duration
Duration is the kotlin.time.Duration. It says
Forbidden vararg parameter type: Duration
. I can't find an explanation for why its forbidden in the docs (https://kotlinlang.org/docs/functions.html#variable-number-of-arguments-varargs)
f

Francesc

10/12/2023, 8:52 PM
it might be because
Duration
is a
value
class
f

Francesc

10/12/2023, 8:54 PM
I was just about to paste the same
t

Travis Griggs

10/12/2023, 8:56 PM
interesting, thanks
complexity breeds complexity 😄
4 Views