that should be:
isimmutable(T::DataType) = !T.mutable
You could add more cases for the other Types (Union, TypeVar, and
TypeConstructor), although whether you need that in practice would be
determined by your use case. Tuple isn't a special case type since mid-2015
(during v0.4-dev)
On Thursday, August 18, 2016 at 2:33:15 PM UTC-4, Steven G. Johnson wrote:
>
>
>
> On Wednesday, August 17, 2016 at 4:51:43 PM UTC-4, Kiran Pamnany wrote:
>>
>> No, I mean when I am passed a type as a function parameter, is there a
>> way to check if it has been declared as an immutable type?
>>
>
> There doesn't seem to be a built-in function for this (the isimmutable
> function works on values, not types), but the following function should
> work:
>
> isimmutable_type{T}(::Type{T}) = T <: Tuple || !T.mutable
>
>