Skip to content

fix(dependency-injection): honor custom scopes in toOverriding, bind(value).to(Class), and close()#89

Merged
deer merged 1 commit into
mainfrom
di_custom_scope
Jun 3, 2026
Merged

fix(dependency-injection): honor custom scopes in toOverriding, bind(value).to(Class), and close()#89
deer merged 1 commit into
mainfrom
di_custom_scope

Conversation

@deer

@deer deer commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator
  • toOverriding(Class) and bind(value).to(Class) now check findScopeEntry before falling through to the isSingleton check, mirroring the canonical bind(Class).to(Class) path. A custom-scoped concrete class no longer silently becomes a prototype in these two binding paths.
  • CustomScopedClassBinding now tracks every distinct instance it produces (by identity) via its value() override.
  • close() now collects instantiated CustomScopedClassBindings alongside LazySingletonClassBindings, builds a unified dependency graph over both, and invokes @PreDestroy on all tracked custom-scoped instances in reverse topological order.

@deer deer merged commit 1b12b43 into main Jun 3, 2026
1 check passed
@deer deer deleted the di_custom_scope branch June 3, 2026 07:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant