Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion base/namedtuple.jl
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ function NamedTuple{names}(nt::NamedTuple) where {names}
types = Tuple{(fieldtype(nt, idx[n]) for n in 1:length(idx))...}
Expr(:new, :(NamedTuple{names, $types}), Any[ :(getfield(nt, $(idx[n]))) for n in 1:length(idx) ]...)
else
length_names = length(names)::Integer
length_names = length(names::Tuple)
types = Tuple{(fieldtype(typeof(nt), names[n]) for n in 1:length_names)...}
NamedTuple{names, types}(map(Fix1(getfield, nt), names))
end
Expand Down
4 changes: 2 additions & 2 deletions stdlib/InteractiveUtils/src/macros.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function recursive_dotcalls!(ex, args, i=1)
end
end
(start, branches) = ex.head === :. ? (1, ex.args[2].args) : (2, ex.args)
length_branches = length(branches)::Integer
length_branches = length(branches)::Int
for j in start:length_branches
branch, i = recursive_dotcalls!(branches[j], args, i)
branches[j] = branch
Expand All @@ -43,7 +43,7 @@ function gen_call_with_extracted_types(__module__, fcn, ex0, kws=Expr[])
end
i = findlast(a->(Meta.isexpr(a, :kw) || Meta.isexpr(a, :parameters)), ex0.args[1].args)
args = copy(ex0.args[1].args)
insert!(args, (isnothing(i) ? 2 : i+1), ex0.args[2])
insert!(args, (isnothing(i) ? 2 : 1+i::Int), ex0.args[2])
ex0 = Expr(:call, args...)
end
if ex0.head === :. || (ex0.head === :call && ex0.args[1] !== :.. && string(ex0.args[1])[1] == '.')
Expand Down