• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

JuliaLang / julia / 1594 / 1594
77%
master: 77%

Build:
DEFAULT BRANCH: master
Ran 01 Mar 2026 11:04AM UTC
Files 350
Run time 10s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

28 Feb 2026 11:58PM UTC coverage: 75.091%. First build
1594

Pull #521

buildkite

web-flow
inference: Propagate conditional type refinement to aliased slots (#61168)

Continuation from #61041 (especially this PR implements @vtjnash 's
idea:
https://github.com/JuliaLang/julia/pull/61041#discussion_r2842290067)

When slot `y` is assigned from slot `x` (`y = x`), both hold the same
value. If a `Conditional` subsequently narrows the type of `x` (e.g. via
`x isa Int`), the same refinement should apply to `y`. The same applies
to `typeassert`-based slot refinements.

This adds `bb_slot_aliases` to `InferenceState` to track slot aliasing
across basic blocks. `slot_aliases[i] == j` means slot `i` currently
holds the same value as slot `j`. The table is always kept flat (aliases
point directly to the root slot), so a single lookup suffices.

Aliasing is tracked at two granularities:

- Intra-BB tracking (`slot_aliases`): this local variable in
`typeinf_local` is updated per-statement and reset at each basic-block
boundary.
- Cross-BB tracking (`bb_slot_aliases`): populated lazily during the
main inference loop by `update_bbstate!`, which copies the exit alias
state to each successor BB on first visit and intersects (meet
operation) on subsequent visits. Only aliases present on _all_ incoming
paths are retained.

When a `Conditional` fires, `refine_aliases!` propagates the same type
narrowing to every slot that is currently aliased to the conditional's
slot. The similar refinements from `apply_refinement!` are also applied.

---

For example, this PR improves type stability in cases like the
following:
```julia
@test Base.infer_return_type((Any,)) do x
    y = x
    if x isa Int
        return sin(y)
    end
    error("x is not Int")
end == Float64
```

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Pull Request #521: WIP: libuv rewrite and Windows port

61854 of 82372 relevant lines covered (75.09%)

8157229.55 hits per line

Source Files on job macos-coverage - 1594
  • Tree
  • List 350
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 1594
  • 44c83579 on github
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc