I have a custom immutable type that wraps an Int16:
julia> immutable DigitSet
d::Int16
end
julia> isbits(DigitSet)
true
I was hoping to be able to reinterpret an Int16 as this type, but I get an
error that confusingly says that the first argument must be a bits type:
julia> reinterpret(DigitSet, Int16(3))
ERROR: reinterpret: expected bits type as first argument
in reinterpret at essentials.jl:115
I can, however, reinterpret a Vector{Int16} into a Vector{DigitSet}.
julia> reinterpret(DigitSet, Int16[3])
1-element Array{DigitSet,1}:
DigitSet(3)
Am I seeing a bug here? Or is this expected for some reason?