Skip to content

Commit

Permalink
Add Compat for TypeUtils
Browse files Browse the repository at this point in the history
  • Loading branch information
Keno committed Jan 13, 2017
1 parent 3541c2d commit 08972f1
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/Compat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1698,4 +1698,14 @@ if VERSION < v"0.6.0-dev.1256"
Base.take!(io::Base.AbstractIOBuffer) = takebuf_array(io)
end

end # module
module TypeUtils
@static if isdefined(Core, :UnionAll)
using Base: isabstract, parameter_upper_bound, unparameterized_type
else
isabstract(t::DataType) = t.abstract
parameter_upper_bound(t::DataType, idx) = t.parameters[idx].ub
unparameterized_type(t::DataType) = t.name.primary
end
export isabstract, parameter_upper_bound, unparameterized_type
end # module TypeUtils
end # module Compat

0 comments on commit 08972f1

Please sign in to comment.