-
-
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
replace export of isleaftype
with a more simply-defined isconcrete
#23666
Conversation
@@ -186,6 +186,7 @@ function find_tvar10930(arg) | |||
end | |||
@test find_tvar10930(Vararg{Int}) === 1 | |||
|
|||
const isleaftype = Base._isleaftype |
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.
Couldn't this be written as using Base: _isleaftype
? That's a little clearer, IMO.
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.
No; this file has a lot of uses of the function and I wanted to avoid the churn of changing all of them.
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.
Okay, thanks for the explanation
base/reflection.jl
Outdated
``` | ||
""" | ||
isleaftype(@nospecialize(t)) = (@_pure_meta; isa(t, DataType) && t.isleaftype) | ||
isconcrete(@nospecialize(t)) = (@_pure_meta; isa(t, DataType) && t.layout != C_NULL) |
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.
layout != C_NULL
merely means that we were able to precompute something about the possible layouts of its concrete subtypes. It's an even more complicated and ill-defined heuristic than isleaftype
was.
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.
Maybe t.layout != C_NULL && t.isleaftype
covers it?
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.
I attempted to pull together a list of the options, and posted it in the original issue to try to avoid forking the original conversation.
4fccb28
to
42101f9
Compare
42101f9
to
a833979
Compare
fixes #17086