Skip to content

Commit b75a067

Browse files
authored
follow up #44404, remove duplicated tmeet definition (#44617)
1 parent e082917 commit b75a067

File tree

1 file changed

+0
-42
lines changed

1 file changed

+0
-42
lines changed

base/compiler/typelattice.jl

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -469,45 +469,3 @@ function stupdate1!(state::VarTable, change::StateUpdate)
469469
end
470470
return false
471471
end
472-
473-
# compute typeintersect over the extended inference lattice,
474-
# as precisely as we can,
475-
# where v is in the extended lattice, and t is a Type.
476-
function tmeet(@nospecialize(v), @nospecialize(t))
477-
if isa(v, Const)
478-
if !has_free_typevars(t) && !isa(v.val, t)
479-
return Bottom
480-
end
481-
return v
482-
elseif isa(v, PartialStruct)
483-
has_free_typevars(t) && return v
484-
widev = widenconst(v)
485-
if widev <: t
486-
return v
487-
end
488-
ti = typeintersect(widev, t)
489-
valid_as_lattice(ti) || return Bottom
490-
@assert widev <: Tuple
491-
new_fields = Vector{Any}(undef, length(v.fields))
492-
for i = 1:length(new_fields)
493-
vfi = v.fields[i]
494-
if isvarargtype(vfi)
495-
new_fields[i] = vfi
496-
else
497-
new_fields[i] = tmeet(vfi, widenconst(getfield_tfunc(t, Const(i))))
498-
if new_fields[i] === Bottom
499-
return Bottom
500-
end
501-
end
502-
end
503-
return tuple_tfunc(new_fields)
504-
elseif isa(v, Conditional)
505-
if !(Bool <: t)
506-
return Bottom
507-
end
508-
return v
509-
end
510-
ti = typeintersect(widenconst(v), t)
511-
valid_as_lattice(ti) || return Bottom
512-
return ti
513-
end

0 commit comments

Comments
 (0)