Skip to content
Permalink
Browse files
1.0 compat
  • Loading branch information
quinnj committed Oct 3, 2020
1 parent a3547f5 commit 6052a4676664160f15ade7b76026efc61984fcd4
Showing 1 changed file with 3 additions and 1 deletion.
@@ -105,7 +105,9 @@ macro scopedenum(T, syms...)
$(Base.Enums.membershiptest(:x, values)) || enum_argument_error($(Expr(:quote, typename)), x)
return Core.bitcast($(esc(typename)), convert($(basetype), x))
end
Base.Enums.namemap(::Type{$(esc(typename))}) = $(esc(namemap))
if isdefined(Base.Enums, :namemap)
Base.Enums.namemap(::Type{$(esc(typename))}) = $(esc(namemap))
end
Base.getproperty(::Type{$(esc(typename))}, sym::Symbol) = sym in $syms ? getfield($(esc(mod)), sym) : getfield($(esc(typename)), sym)
Base.typemin(x::Type{$(esc(typename))}) = $(esc(typename))($lo)
Base.typemax(x::Type{$(esc(typename))}) = $(esc(typename))($hi)

0 comments on commit 6052a46

Please sign in to comment.