Skip to content

Commit

Permalink
fix package for the upcoming 1.7 release (#76)
Browse files Browse the repository at this point in the history
* fix package for the upcoming 1.7 release

* Update base-traits.jl

* Update base-traits.jl
  • Loading branch information
KristofferC authored Jul 2, 2021
1 parent 300480d commit da9670e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/base-traits.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,16 @@ export IsLeafType, IsConcrete, IsBits, IsImmutable, IsContiguous, IsIndexLinear,

"Trait of all isbits-types"
@traitdef IsBits{X}
Base.@pure _isbits(X) = X.isbitstype
Base.@pure _isbits(X) = isbitstype(X)
@traitimpl IsBits{X} <- _isbits(X)

"Trait of all immutable types"
@traitdef IsImmutable{X}
Base.@pure _isimmutable(X) = !X.mutable
if VERSION >= v"1.7.0-DEV.1279"
Base.@pure _isimmutable(X) = !(Base.ismutabletype(X))
else
Base.@pure _isimmutable(X) = !X.mutable
end
@traitimpl IsImmutable{X} <- _isimmutable(X)

"Trait of all callable objects"
Expand Down

0 comments on commit da9670e

Please sign in to comment.