Skip to content

Commit

Permalink
replace more 'leaf type' occurences with 'concrete type'
Browse files Browse the repository at this point in the history
Co-authored-by: inkydragon <[email protected]>
  • Loading branch information
fatteneder and inkydragon committed Nov 3, 2024
1 parent 4e2ea18 commit c2f1d6f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions base/reflection.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ yielded by expanding the generators.
The keyword `debuginfo` controls the amount of code metadata present in the output.
Note that an error will be thrown if `types` are not leaf types when `generated` is
Note that an error will be thrown if `types` are not concrete types when `generated` is
`true` and any of the corresponding methods are an `@generated` method.
"""
function code_lowered(@nospecialize(f), @nospecialize(t=Tuple); generated::Bool=true, debuginfo::Symbol=:default)
Expand All @@ -37,7 +37,7 @@ function code_lowered(@nospecialize(f), @nospecialize(t=Tuple); generated::Bool=
else
error("Could not expand generator for `@generated` method ", m, ". ",
"This can happen if the provided argument types (", t, ") are ",
"not leaf types, but the `generated` argument is `true`.")
"not concrete types, but the `generated` argument is `true`.")
end
else
code = uncompressed_ir(m.def::Method)
Expand Down
4 changes: 2 additions & 2 deletions base/runtime_internals.jl
Original file line number Diff line number Diff line change
Expand Up @@ -839,7 +839,7 @@ end
"""
isdispatchtuple(T)
Determine whether type `T` is a tuple "leaf type",
Determine whether type `T` is a tuple of concrete types,
meaning it could appear as a type signature in dispatch
and has no subtypes (or supertypes) which could appear in a call.
If `T` is not a type, then return `false`.
Expand Down Expand Up @@ -894,7 +894,7 @@ isconcretedispatch(@nospecialize t) = isconcretetype(t) && !iskindtype(t)
using Core: has_free_typevars

# equivalent to isa(v, Type) && isdispatchtuple(Tuple{v}) || v === Union{}
# and is thus perhaps most similar to the old (pre-1.0) `isleaftype` query
# and is thus perhaps most similar to the old (pre-1.0) `isconcretetype` query
function isdispatchelem(@nospecialize v)
return (v === Bottom) || (v === typeof(Bottom)) || isconcretedispatch(v) ||
(isType(v) && !has_free_typevars(v))
Expand Down
4 changes: 2 additions & 2 deletions stdlib/InteractiveUtils/src/codeview.jl
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,10 @@ end
Prints lowered and type-inferred ASTs for the methods matching the given generic function
and type signature to `io` which defaults to `stdout`. The ASTs are annotated in such a way
as to cause "non-leaf" types which may be problematic for performance to be emphasized
as to cause non-concrete types which may be problematic for performance to be emphasized
(if color is available, displayed in red). This serves as a warning of potential type instability.
Not all non-leaf types are particularly problematic for performance, and the performance
Not all non-concrete types are particularly problematic for performance, and the performance
characteristics of a particular type is an implementation detail of the compiler.
`code_warntype` will err on the side of coloring types red if they might be a performance
concern, so some types may be colored red even if they do not impact performance.
Expand Down

0 comments on commit c2f1d6f

Please sign in to comment.