Skip to content

Commit aa2d7c4

Browse files
ranochaKristofferC
authored andcommitted
fix invalidations when loading ForwardDiff.jl (#47091)
(cherry picked from commit 0dada17)
1 parent 1e78c64 commit aa2d7c4

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Diff for: base/namedtuple.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ function NamedTuple{names}(nt::NamedTuple) where {names}
111111
types = Tuple{(fieldtype(nt, idx[n]) for n in 1:length(idx))...}
112112
Expr(:new, :(NamedTuple{names, $types}), Any[ :(getfield(nt, $(idx[n]))) for n in 1:length(idx) ]...)
113113
else
114-
length_names = length(names)::Integer
114+
length_names = length(names::Tuple)
115115
types = Tuple{(fieldtype(typeof(nt), names[n]) for n in 1:length_names)...}
116116
NamedTuple{names, types}(map(Fix1(getfield, nt), names))
117117
end

Diff for: stdlib/InteractiveUtils/src/macros.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ function recursive_dotcalls!(ex, args, i=1)
2424
end
2525
end
2626
(start, branches) = ex.head === :. ? (1, ex.args[2].args) : (2, ex.args)
27-
length_branches = length(branches)::Integer
27+
length_branches = length(branches)::Int
2828
for j in start:length_branches
2929
branch, i = recursive_dotcalls!(branches[j], args, i)
3030
branches[j] = branch
@@ -40,7 +40,7 @@ function gen_call_with_extracted_types(__module__, fcn, ex0, kws=Expr[])
4040
end
4141
i = findlast(a->(Meta.isexpr(a, :kw) || Meta.isexpr(a, :parameters)), ex0.args[1].args)
4242
args = copy(ex0.args[1].args)
43-
insert!(args, (isnothing(i) ? 2 : i+1), ex0.args[2])
43+
insert!(args, (isnothing(i) ? 2 : 1+i::Int), ex0.args[2])
4444
ex0 = Expr(:call, args...)
4545
end
4646
if ex0.head === :. || (ex0.head === :call && ex0.args[1] !== :.. && string(ex0.args[1])[1] == '.')

0 commit comments

Comments
 (0)