Re: [julia-users] Why can't I reinterpret a single value to a custom immutable type?

2015-11-04 Thread Yichao Yu
On Wed, Nov 4, 2015 at 8:44 AM, Jason Merrill wrote: > 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

[julia-users] Why can't I reinterpret a single value to a custom immutable type?

2015-11-04 Thread Jason Merrill
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>