From 89c1ae32996fe510dc1c7bff44b5d2d3520ad8b1 Mon Sep 17 00:00:00 2001 From: Brandon Roberts Date: Sun, 31 May 2026 14:43:37 -0500 Subject: [PATCH] fix(partial): handle FactoryTarget::Service in partial factory emit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- crates/oxc_angular_compiler/src/partial/factory.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/oxc_angular_compiler/src/partial/factory.rs b/crates/oxc_angular_compiler/src/partial/factory.rs index 7105fa2b3..817b2184a 100644 --- a/crates/oxc_angular_compiler/src/partial/factory.rs +++ b/crates/oxc_angular_compiler/src/partial/factory.rs @@ -175,7 +175,7 @@ fn factory_target_expr<'a>( FactoryTarget::Directive => "Directive", FactoryTarget::Pipe => "Pipe", FactoryTarget::NgModule => "NgModule", - FactoryTarget::Injectable => "Injectable", + FactoryTarget::Injectable | FactoryTarget::Service => "Injectable", }; let factory_target_ref = OutputExpression::ReadProp(Box::new_in(