Skip to content

Commit

Permalink
fix invalidations when loading ForwardDiff.jl (#47091)
Browse files Browse the repository at this point in the history
(cherry picked from commit 0dada17)
  • Loading branch information
ranocha authored and KristofferC committed Oct 27, 2022
1 parent 36c9188 commit d1b2980
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
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 @@ -40,7 +40,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

0 comments on commit d1b2980

Please sign in to comment.