-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow UnionAll as input to subtypes and include UnionAll in its output #20307
Conversation
base/reflection.jl
Outdated
end | ||
end | ||
end | ||
return sts | ||
end | ||
subtypes(m::Module, x::DataType) = sort(collect(_subtypes(m, x)), by=string) | ||
subtypes(m::Module, x::Union{DataType,UnionAll}) = sort(collect(_subtypes(m, x)), by=string) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sort!(collect(...))
?
dd4e531
to
c6d705e
Compare
Lgtm. Although none of those type asserts should be impactful. |
c6d705e
to
2798d2c
Compare
Removed the |
The hang was causing by trying to serialize/deserialize |
2798d2c
to
847b8e3
Compare
847b8e3
to
9524cc0
Compare
Rebased on top of #20006. |
base/reflection.jl
Outdated
end | ||
end | ||
end | ||
return sts | ||
end | ||
subtypes(m::Module, x::DataType) = x.abstract ? sort!(collect(_subtypes(m, x)), by=string) : DataType[] | ||
subtypes(m::Module, x::Union{DataType,UnionAll}) = isabstract(x) ? sort!(collect(_subtypes(m, x)), by=string) : Union{DataType,UnionAll}[] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getting to be a long line, either wrap or give the union a shorter alias?
9524cc0
to
2dd2176
Compare
Replaces #20084 with tests mostly taken from it.