Skip to content

fix(resolution): follow alias bindings to the function they name (#1482) - #1808

Merged
colbymchenry merged 1 commit into
mainfrom
forge/fix-1482-alias-binding
Sep 9, 2026
Merged

colbymchenry merged 1 commit into
mainfrom
forge/fix-1482-alias-binding

Conversation

@colbymchenry

Copy link
Copy Markdown
Owner

Summary

  • Lands upstream #1485 (@valkyriweb) adapted onto current main: value aliases (export const alias = fn, export { fn as alias }, object-literal property refs, same-file aliases) forward calls edges to the aliased callable so callers/impact include consumers that call through the alias.
  • Preserves current gateTargetKind / resolveOneInner structure and defaultBinding export indexing; adds src/resolution/alias-binding.ts and six focused tests from upstream verbatim.
  • Fixes #1482. Supersedes #1485.

Linux verify (fail → pass)

On the issue's 2-file repro (import { aliasName } from "./impl.js"):

  • Before (main): callers realImpl / impact realImpl omit consumerFn
  • After: both include consumerFn / consumer.ts
  • Vitest: __tests__/alias-binding-resolution.test.ts 6/6; related resolver suites 231/231

Test plan

  • Rebuild tsc + assets
  • Re-init issue repro; confirm callers/impact include consumerFn
  • Focused + related vitest suites

Adapt upstream PR #1485 by @valkyriweb (cc791cf)
onto current main. Keep the upstream alias-binding module and six-test suite
verbatim, preserve target-kind gating and default-export bindings, and add
one credited Unreleased changelog entry.

Linux verification (x86_64, Node 22.19.0): TypeScript build and asset copy
pass; the fresh ./impl.js repro changes callers/impact of realImpl from
missing consumerFn to including it. All 6 upstream tests and 231 related
resolver regression tests pass.

Fixes #1482

The Forge PR will supersede upstream PR #1485.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant