You need
julia> num_chunks(Val(9))
(1, UInt16)
Val is for taking a normal value and making a special type out of it.
Sometimes people use this for a bit of extra performance, but it makes the code somewhat awkward and doesn’t necessarily actually help performance. I think it used to be more helpful for performance in an earlier Julia version than it is now, due to more recent developments in the compiler. It’s possible it might be used unnecessarily here.