From 8733d7cf2dec45e08f9629aeb0a3daa142183aa5 Mon Sep 17 00:00:00 2001 From: Shuhei Kadowaki Date: Tue, 15 Mar 2022 12:29:12 +0900 Subject: [PATCH] follow up #44404, remove duplicated `tmeet` definition --- base/compiler/typelattice.jl | 42 ------------------------------------ 1 file changed, 42 deletions(-) diff --git a/base/compiler/typelattice.jl b/base/compiler/typelattice.jl index f6eb92a040f2a..79db3b6cf20b6 100644 --- a/base/compiler/typelattice.jl +++ b/base/compiler/typelattice.jl @@ -469,45 +469,3 @@ function stupdate1!(state::VarTable, change::StateUpdate) end return false end - -# compute typeintersect over the extended inference lattice, -# as precisely as we can, -# where v is in the extended lattice, and t is a Type. -function tmeet(@nospecialize(v), @nospecialize(t)) - if isa(v, Const) - if !has_free_typevars(t) && !isa(v.val, t) - return Bottom - end - return v - elseif isa(v, PartialStruct) - has_free_typevars(t) && return v - widev = widenconst(v) - if widev <: t - return v - end - ti = typeintersect(widev, t) - valid_as_lattice(ti) || return Bottom - @assert widev <: Tuple - new_fields = Vector{Any}(undef, length(v.fields)) - for i = 1:length(new_fields) - vfi = v.fields[i] - if isvarargtype(vfi) - new_fields[i] = vfi - else - new_fields[i] = tmeet(vfi, widenconst(getfield_tfunc(t, Const(i)))) - if new_fields[i] === Bottom - return Bottom - end - end - end - return tuple_tfunc(new_fields) - elseif isa(v, Conditional) - if !(Bool <: t) - return Bottom - end - return v - end - ti = typeintersect(widenconst(v), t) - valid_as_lattice(ti) || return Bottom - return ti -end