{"record":{"id":"767d916ad2b4af8f","repo":"swc-project/swc","slug":"unknown-suffix","errorCode":null,"errorMessage":"Unknown suffix `{}`","messagePattern":"Unknown suffix `(.+?)`","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"info","filePath":"crates/swc_ecma_transforms_macros/src/parallel.rs","lineNumber":45,"sourceCode":"        .unwrap_or(false);\n\n    item.items.push(ImplItem::Fn(make_par_visit_method(\n        mode,\n        \"module_items\",\n        explode,\n    )));\n    item.items\n        .push(ImplItem::Fn(make_par_visit_method(mode, \"stmts\", explode)));\n\n    item\n}\n\nfn node_type(suffix: &str) -> Type {\n    match suffix {\n        \"module_items\" => parse_quote!(ModuleItem),\n        \"stmts\" => parse_quote!(Stmt),\n        _ => {\n            unimplemented!(\"Unknown suffix `{}`\", suffix)\n        }\n    }\n}\n\nfn post_visit_hook(mode: Mode, suffix: &str) -> Option<Expr> {\n    match suffix {\n        \"module_items\" => Some(match mode {\n            Mode::Fold => parse_quote!(\n                swc_ecma_transforms_base::perf::Parallel::after_module_items(self, &mut nodes)\n            ),\n\n            Mode::VisitMut => parse_quote!(\n                swc_ecma_transforms_base::perf::Parallel::after_module_items(self, nodes)\n            ),\n        }),\n        \"stmts\" => Some(match mode {\n            Mode::Fold => parse_quote!(swc_ecma_transforms_base::perf::Parallel::after_stmts(\n                self, &mut nodes","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/swc-project/swc/blob/d7d74346665e36e692aa07e13d4ee3ee692ee35c/crates/swc_ecma_transforms_macros/src/parallel.rs#L27-L63","documentation":"Internal helper of the `#[parallel]` macro: `node_type` maps the suffix of generated visit methods (`module_items`, `stmts`) to AST types (`ModuleItem`, `Stmt`). The macro's `expand` only ever calls it with those two literals, so `unimplemented!(\"Unknown suffix ...\")` is unreachable from user code and acts as a completeness check for maintainers.","triggerScenarios":"Not triggerable through normal macro usage; fires only if parallel.rs is modified to emit a method with a new suffix without extending `node_type`.","commonSituations":"Only swc contributors extending the #[parallel] macro itself.","solutions":["If extending the macro, add the new suffix mapping in `node_type` and the matching arm in `post_visit_hook`","No user-side action; if you see this panic on an unmodified swc, report it upstream"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Maintainers: when adding a new method suffix to #[parallel], extend `node_type` and `post_visit_hook` in the same change","Users seeing this panic on stock swc should report it — it indicates a patched or corrupted macro"],"tags":["macro","parallel","internal"],"backgroundTag":null,"analyzedSha":"d7d74346665e36e692aa07e13d4ee3ee692ee35c","analyzedAt":"2026-08-16T12:41:13.160Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}