Skip to content

Commit 889add5

Browse files
committed
we've never compared Conditional and InterConditional
1 parent b6bbf6a commit 889add5

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

base/compiler/typelattice.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,9 @@ const CompilerTypes = Union{MaybeUndef, Const, Conditional, NotFound, PartialStr
9898
# lattice logic #
9999
#################
100100

101-
function issubconditional(a::AnyConditional, b::AnyConditional)
101+
# `Conditional` and `InterConditional` are valid in opposite contexts
102+
# (i.e. local and interprocedural call), as such they will never be compared
103+
function issubconditional(a::C, b::C) where {C<:AnyConditional}
102104
if is_same_conditionals(a, b)
103105
if a.vtype b.vtype
104106
if a.elsetype b.elsetype
@@ -109,8 +111,6 @@ function issubconditional(a::AnyConditional, b::AnyConditional)
109111
return false
110112
end
111113
is_same_conditionals(a::Conditional, b::Conditional) = slot_id(a.var) === slot_id(b.var)
112-
is_same_conditionals(a::Conditional, b::InterConditional) = slot_id(a.var) === b.slot
113-
is_same_conditionals(a::InterConditional, b::Conditional) = is_same_conditionals(b, a)
114114
is_same_conditionals(a::InterConditional, b::InterConditional) = a.slot === b.slot
115115

116116
maybe_extract_const_bool(c::Const) = isa(c.val, Bool) ? c.val : nothing

base/compiler/typelimits.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ function tmerge(@nospecialize(typea), @nospecialize(typeb))
327327
end
328328
return Bool
329329
end
330-
# type-lattice for InterConditional wrapper, InterConditional won't be merged with Conditional
330+
# type-lattice for InterConditional wrapper, InterConditional will never be merged with Conditional
331331
if isa(typea, InterConditional) && isa(typeb, Const)
332332
if typeb.val === true
333333
typeb = InterConditional(typea.slot, Any, Union{})

0 commit comments

Comments
 (0)