Skip to content
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

Merged
merged 1 commit into from
Sep 13, 2017

Conversation

JeffBezanson
Copy link
Sponsor Member

fixes #17086

@@ -186,6 +186,7 @@ function find_tvar10930(arg)
end
@test find_tvar10930(Vararg{Int}) === 1

const isleaftype = Base._isleaftype
Copy link
Member

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.

Copy link
Sponsor Member Author

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.

Copy link
Member

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

@ararslan ararslan added kind:deprecation This change introduces or involves a deprecation needs news A NEWS entry is required for this change domain:types and dispatch Types, subtyping and method dispatch labels Sep 11, 2017
```
"""
isleaftype(@nospecialize(t)) = (@_pure_meta; isa(t, DataType) && t.isleaftype)
isconcrete(@nospecialize(t)) = (@_pure_meta; isa(t, DataType) && t.layout != C_NULL)
Copy link
Sponsor Member

@vtjnash vtjnash Sep 12, 2017

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.

Copy link
Sponsor Member Author

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?

Copy link
Sponsor Member

@vtjnash vtjnash Sep 12, 2017

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.

@JeffBezanson JeffBezanson removed the needs news A NEWS entry is required for this change label Sep 12, 2017
@JeffBezanson JeffBezanson merged commit 55ec9fe into master Sep 13, 2017
@JeffBezanson JeffBezanson deleted the jb/isconcrete branch September 13, 2017 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:types and dispatch Types, subtyping and method dispatch kind:deprecation This change introduces or involves a deprecation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rename isleaftype
3 participants