Skip to content

refactor(runtime): Resolve scoped factory dependencies in the owning scope#198

Merged
harrytmthy merged 1 commit into
mainfrom
refactor/scoped-factory-dependency-resolution
Apr 23, 2026
Merged

refactor(runtime): Resolve scoped factory dependencies in the owning scope#198
harrytmthy merged 1 commit into
mainfrom
refactor/scoped-factory-dependency-resolution

Conversation

@harrytmthy

Copy link
Copy Markdown
Owner

Summary

This PR fixes runtime parent-child scoped resolution so nested get() calls inside scoped factory lambdas resolve in the binding's owning scope instead of the original requesting scope.

Implementation Details

ResolutionContext now updates its active scope while a binding is being resolved, allowing scoped factory dependencies to follow the visibility of the owning scope when ancestor-owned bindings are built from child scopes. This restores correct runtime scope semantics for hierarchical scoped resolution and prevents incorrect dependency traversal in nested get() calls. The PR also includes a small cleanup around Module initialization and registration API shape.

Closes #197

@harrytmthy harrytmthy added this to the 1.0.0 milestone Apr 23, 2026
@harrytmthy harrytmthy self-assigned this Apr 23, 2026
@harrytmthy harrytmthy added the refactor Internal code design/structure improvement label Apr 23, 2026
@harrytmthy
harrytmthy force-pushed the refactor/scoped-factory-dependency-resolution branch from 4224699 to cb0e9da Compare April 23, 2026 11:32
@harrytmthy
harrytmthy enabled auto-merge (squash) April 23, 2026 11:33
@harrytmthy
harrytmthy merged commit 247cc7b into main Apr 23, 2026
1 check passed
@harrytmthy
harrytmthy deleted the refactor/scoped-factory-dependency-resolution branch April 23, 2026 11:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Internal code design/structure improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Resolve scoped factory dependencies in the owning scope for runtime parent-child scopes

1 participant