-
-
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
Rename isleaftype() to isconcrete() #20709
Closed
Closed
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
077420c
Rename isleaftype() to isconcrete()
nalimilan 471791d
Add missing closing triple backticks in isconcrete() docstring
nalimilan fd4283c
Merge branch 'master' into nl/isconcrete
nalimilan 1fdcdb0
Merge branch 'master' into nl/isconcrete
tkelman 3813421
fix the at-deprecate call
tkelman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -949,7 +949,7 @@ export | |
fieldname, | ||
fieldnames, | ||
fieldcount, | ||
isleaftype, | ||
isconcrete, | ||
oftype, | ||
promote, | ||
promote_rule, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -283,27 +283,27 @@ isbits(t::Type) = (@_pure_meta; false) | |
isbits(x) = (@_pure_meta; isbits(typeof(x))) | ||
|
||
""" | ||
isleaftype(T) | ||
isconcrete(T) | ||
|
||
Determine whether `T`'s only subtypes are itself and `Union{}`. This means `T` is | ||
a concrete type that can have instances. | ||
|
||
# Examples | ||
```jldoctest | ||
julia> isleaftype(Complex) | ||
julia> isconcrete(Complex) | ||
false | ||
|
||
julia> isleaftype(Complex{Float32}) | ||
julia> isconcrete(Complex{Float32}) | ||
true | ||
|
||
julia> isleaftype(Vector{Complex}) | ||
julia> isconcrete(Vector{Complex}) | ||
true | ||
|
||
julia> isleaftype(Vector{Complex{Float32}}) | ||
julia> isconcrete(Vector{Complex{Float32}}) | ||
true | ||
``` | ||
""" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. closing triple backtick missing here, as mentioned by @tkoolen There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See new commit. |
||
isleaftype(@nospecialize(t)) = (@_pure_meta; isa(t, DataType) && t.isleaftype) | ||
isconcrete(@nospecialize(t)) = (@_pure_meta; isa(t, DataType) && t.isconcrete) | ||
|
||
""" | ||
Base.isabstract(T) | ||
|
@@ -767,8 +767,8 @@ function _dump_function_linfo(linfo::Core.MethodInstance, world::UInt, native::B | |
(Ptr{Void}, Bool, Bool), llvmf, strip_ir_metadata, dump_module) | ||
end | ||
|
||
# TODO: use jl_is_cacheable_sig instead of isleaftype | ||
isleaftype(linfo.specTypes) || (str = "; WARNING: This code may not match what actually runs.\n" * str) | ||
# TODO: use jl_is_cacheable_sig instead of isconcrete | ||
isconcrete(linfo.specTypes) || (str = "; WARNING: This code may not match what actually runs.\n" * str) | ||
return str | ||
end | ||
|
||
|
@@ -797,9 +797,9 @@ code_native(io::IO, @nospecialize(f), @nospecialize(types=Tuple), syntax::Symbol | |
code_native(@nospecialize(f), @nospecialize(types=Tuple), syntax::Symbol=:att) = code_native(STDOUT, f, types, syntax) | ||
code_native(::IO, ::Any, ::Symbol) = error("illegal code_native call") # resolve ambiguous call | ||
|
||
# give a decent error message if we try to instantiate a staged function on non-leaf types | ||
# give a decent error message if we try to instantiate a staged function on non-concrete types | ||
function func_for_method_checked(m::Method, @nospecialize types) | ||
if isdefined(m,:generator) && !isdefined(m,:source) && !isleaftype(types) | ||
if isdefined(m,:generator) && !isdefined(m,:source) && !isconcrete(types) | ||
error("cannot call @generated function `", m, "` ", | ||
"with abstract argument types: ", types) | ||
end | ||
|
@@ -861,7 +861,7 @@ function which(@nospecialize(f), @nospecialize(t)) | |
throw(ArgumentError("argument is not a generic function")) | ||
end | ||
t = to_tuple_type(t) | ||
if isleaftype(t) | ||
if isconcrete(t) | ||
ms = methods(f, t) | ||
isempty(ms) && error("no method found for the specified argument types") | ||
length(ms)!=1 && error("no unique matching method for the specified argument types") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@deprecate isleaftype isconcrete
? Or are you trying to deprecate what you just introduced?... by what you just introduced.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.
fixed in 3813421 - I think this was a mistake during the conflict resolution in fd4283c