Skip to content

Commit

Permalink
Reduce invalidation with type assertion
Browse files Browse the repository at this point in the history
Duplicates improvement made to Base's Enums: JuliaLang/julia#35928
  • Loading branch information
jmert committed Sep 9, 2020
1 parent 9f2d512 commit 7f6276a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/BitFlags.jl
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ macro bitflag(T, syms...)
else
throw(ArgumentError(string("invalid argument for BitFlag ", typename, ": ", s)))
end
s = s::Symbol
if !Base.isidentifier(s)
throw(ArgumentError("invalid name for BitFlag $typename; "
* "\"$s\" is not a valid identifier"))
Expand Down

0 comments on commit 7f6276a

Please sign in to comment.