-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Labels
bugIndicates an unexpected problem or unintended behaviorIndicates an unexpected problem or unintended behaviorcompiler:inferenceType inferenceType inference
Description
Ooops:
julia> proj1(a, b) = a
proj1 (generic function with 2 methods)
julia> function foo(a)
a = Base.inferencebarrier(a)::Union{Int64, Float64}
if proj1(isa(a, Int64), (a = Base.inferencebarrier(1.0)::Union{Int64, Float64}; true))
return a
end
return 2
end
foo (generic function with 2 methods)
julia> foo(1)
4607182418800017408
Basically, this code doesn't know about SSAValues:
julia/base/compiler/typelattice.jl
Lines 749 to 757 in 86cba99
function invalidate_slotwrapper(vt::VarState, changeid::Int, ignore_conditional::Bool) | |
newtyp = ignorelimited(vt.typ) | |
if (!ignore_conditional && isa(newtyp, Conditional) && newtyp.slot == changeid) || | |
(isa(newtyp, MustAlias) && newtyp.slot == changeid) | |
newtyp = @noinline widenwrappedslotwrapper(vt.typ) | |
return VarState(newtyp, vt.undef) | |
end | |
return nothing | |
end |
But it's not clear what a sound way to change that is.
Metadata
Metadata
Assignees
Labels
bugIndicates an unexpected problem or unintended behaviorIndicates an unexpected problem or unintended behaviorcompiler:inferenceType inferenceType inference