SIGN IN SIGN UP

Base.Docs: fix Binding constructor for renamed imports (#61869)

The stock `Base.Docs.Binding(m, v)` constructor keeps the local symbol
`v` while normalising the module via `binding_module(m, v)`. For renamed
imports such as `using X: y as z`, this produces a binding to a
non-existent `canonical_owner.z`, so `?` doc lookup fails:

    julia> using Base: isvisible as iv

    help?> iv
      No documentation found.
      Binding `Base.iv` does not exist.

Resolve the alias via the binding partition system: when the local
binding's partition kind is `PARTITION_KIND_EXPLICIT` or
`PARTITION_KIND_IMPORTED` — the only kinds whose surface syntax (`using
X: y as z` / `import X: y as z`) admits an `as`-rename — the partition's
restriction is the underlying `Core.Binding` whose globalref carries the
canonical `(mod, name)` pair. Use that pair instead.

Re-lands #55119 with the binding partition API after the original
`jl_binding_owner`-based fix became stale (that C function no longer
exists on master).

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
S
Shuhei Kadowaki committed
e5d7225bad6a56ce52d08fb35bf4579da51ba6d1
Parent: c07cf8f
Committed by GitHub <noreply@github.com> on 5/23/2026, 3:09:29 AM