Skip to content

Commit f45a8b5

Browse files
committed
wip: lattice overhaul step 3: simplify lattice comparisons
1 parent 269a1c7 commit f45a8b5

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

base/compiler/abstractinterpretation.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1696,7 +1696,7 @@ function abstract_eval_statement(interp::AbstractInterpreter, @nospecialize(e),
16961696
end
16971697
if !anyrefine
16981698
anyrefine = has_nontrivial_const_info(at) || # constant information
1699-
at ft # just a type-level information, but more precise than the declared type
1699+
at ft # just a type-level information, but more precise than the declared type
17001700
end
17011701
ats[i-1] = at
17021702
end

base/compiler/typelattice.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -473,20 +473,20 @@ The non-strict partial order over the type inference lattice.
473473
end
474474

475475
"""
476-
a ⊏ b -> Bool
476+
a::LatticeElement ⊏ b::LatticeElement -> Bool
477477
478478
The strict partial order over the type inference lattice.
479479
This is defined as the irreflexive kernel of `⊑`.
480480
"""
481-
@nospecialize(a) @nospecialize(b) = a b && !(b, a)
481+
a::LatticeElement b::LatticeElement = a b && !(b, a)
482482

483483
"""
484-
a ⋤ b -> Bool
484+
a::LatticeElement ⋤ b::LatticeElement -> Bool
485485
486486
This order could be used as a slightly more efficient version of the strict order `⊏`,
487487
where we can safely assume `a ⊑ b` holds.
488488
"""
489-
@nospecialize(a) @nospecialize(b) = !(b, a)
489+
a::LatticeElement b::LatticeElement = !(b, a)
490490

491491
a::LatticeElement @nospecialize(b#=::Type=#) = widenconst(a) <: b
492492
a::LatticeElement @nospecialize(b#=::Type=#) = widenconst(a) <: b && !(b <: widenconst(a))

0 commit comments

Comments
 (0)