fix(partial): handle FactoryTarget::Service in partial factory emit#329
Merged
Conversation
Building main fails after #324 (@service) and #325 (partial mode) landed sequentially: error[E0004]: non-exhaustive patterns: `FactoryTarget::Service` not covered --> crates/oxc_angular_compiler/src/partial/factory.rs:173:25 #324 added the new variant; #325 added the partial factory emitter. Each branch passed CI independently, but the variant was missing from the match in partial mode's `factory_target_expr`. Group Service with Injectable in the partial-emit match arm. At runtime Service factories use the same `ɵɵinject` token path as Injectable — see `factory/compiler.rs:664` where they're already grouped in the full-mode dispatch — so the partial declaration's `target: i0.ɵɵFactoryTarget.Injectable` produces the correct linked factory. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Brooooooklyn
approved these changes
Jun 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes a build break on
mainafter #324 (@Servicedecorator AOT) and #325 (partial-declaration emit) landed sequentially.#324 added a new
FactoryTarget::Serviceenum variant. #325 added the partial factory emitter with an exhaustive match onFactoryTarget. Each PR passed CI on its own branch, but the new variant wasn't added to the match in the partial emitter — socargo buildonmainnow fails:Fix
Group
ServicewithInjectablein the partial-emit match. At runtime, Service factories use the sameɵɵinjecttoken path as Injectable —factory/compiler.rs:664already groups them in the full-mode dispatch — so the partial declaration'starget: i0.ɵɵFactoryTarget.Injectableproduces the correct linked factory.Test plan
cargo build -p oxc_angular_compiler— cleancargo test -p oxc_angular_compiler— 2689 passed, 0 failedpnpm build(full native + tsc) — clean@ServiceAOT gains its own partial-emit slice with a properɵɵngDeclareServiceshape, swap the match arm to a dedicated"Service"variant and add aFactoryTarget::Servicetest fixture.🤖 Generated with Claude Code