We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3541c2d commit 08972f1Copy full SHA for 08972f1
src/Compat.jl
@@ -1698,4 +1698,14 @@ if VERSION < v"0.6.0-dev.1256"
1698
Base.take!(io::Base.AbstractIOBuffer) = takebuf_array(io)
1699
end
1700
1701
-end # module
+module TypeUtils
1702
+ @static if isdefined(Core, :UnionAll)
1703
+ using Base: isabstract, parameter_upper_bound, unparameterized_type
1704
+ else
1705
+ isabstract(t::DataType) = t.abstract
1706
+ parameter_upper_bound(t::DataType, idx) = t.parameters[idx].ub
1707
+ unparameterized_type(t::DataType) = t.name.primary
1708
+ end
1709
+ export isabstract, parameter_upper_bound, unparameterized_type
1710
+end # module TypeUtils
1711
+end # module Compat
0 commit comments