Skip to content
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

minor typing improvements for InferenceState.stmt_types #39096

Merged
merged 1 commit into from
Jan 6, 2021
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/compiler/abstractinterpretation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1364,7 +1364,7 @@ function typeinf_local(interp::AbstractInterpreter, frame::InferenceState)
frame.cur_hand = Pair{Any,Any}(l, frame.cur_hand)
# propagate type info to exception handler
old = s[l]
new = s[pc]::Array{Any,1}
new = s[pc]::VarTable
newstate_catch = stupdate!(old, new)
if newstate_catch !== false
if l < frame.pc´´
Expand Down
4 changes: 2 additions & 2 deletions base/compiler/inferencestate.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ mutable struct InferenceState
world::UInt
valid_worlds::WorldRange
nargs::Int
stmt_types::Vector{Any}
stmt_types::Vector{Union{Nothing, Vector{Any}}} # ::Vector{Union{Nothing, VarTable}}
stmt_edges::Vector{Union{Nothing, Vector{Any}}}
stmt_info::Vector{Any}
# return type
Expand Down Expand Up @@ -67,7 +67,7 @@ mutable struct InferenceState

n = length(code)
s_edges = Union{Nothing, Vector{Any}}[ nothing for i = 1:n ]
s_types = Any[ nothing for i = 1:n ]
s_types = Union{Nothing, Vector{Any}}[ nothing for i = 1:n ]

# initial types
nslots = length(src.slotflags)
Expand Down
2 changes: 1 addition & 1 deletion base/compiler/typeinfer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ function type_annotate!(sv::InferenceState)
src = sv.src
states = sv.stmt_types
nargs = sv.nargs
nslots = length(states[1]::Array{Any,1})
nslots = length(states[1]::VarTable)
undefs = fill(false, nslots)
body = src.code::Array{Any,1}
nexpr = length(body)
Expand Down