{"id":"d480cad3a0e2f7b4","repo":"rollup/rollup","slug":"not-implemented-cannot-convert-simpleassigntarget-d480ca","errorCode":null,"errorMessage":"not implemented: Cannot convert SimpleAssignTarget::TsNonNull","messagePattern":"not implemented: Cannot convert SimpleAssignTarget::TsNonNull","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"rust/parse_ast/src/convert_ast/converter.rs","lineNumber":720,"sourceCode":"      SimpleAssignTarget::Ident(binding_identifier) => {\n        self.convert_binding_identifier(binding_identifier)\n      }\n      SimpleAssignTarget::Member(member_expression) => {\n        self.convert_member_expression(member_expression, false, false)\n      }\n      SimpleAssignTarget::SuperProp(super_property) => self.convert_super_property(super_property),\n      SimpleAssignTarget::Paren(parenthesized_expression) => {\n        self.convert_parenthesized_expression(parenthesized_expression);\n      }\n      SimpleAssignTarget::OptChain(optional_chain_expression) => {\n        self.store_chain_expression(optional_chain_expression, false)\n      }\n      SimpleAssignTarget::TsAs(_) => unimplemented!(\"Cannot convert SimpleAssignTarget::TsAs\"),\n      SimpleAssignTarget::TsSatisfies(_) => {\n        unimplemented!(\"Cannot convert SimpleAssignTarget::TsSatisfies\")\n      }\n      SimpleAssignTarget::TsNonNull(_) => {\n        unimplemented!(\"Cannot convert SimpleAssignTarget::TsNonNull\")\n      }\n      SimpleAssignTarget::TsTypeAssertion(_) => {\n        unimplemented!(\"Cannot convert SimpleAssignTarget::TsTypeAssertion\")\n      }\n      SimpleAssignTarget::TsInstantiation(_) => {\n        unimplemented!(\"Cannot convert SimpleAssignTarget::TsInstantiation\")\n      }\n      SimpleAssignTarget::Invalid(_) => {\n        unimplemented!(\"Cannot convert SimpleAssignTarget::Invalid\")\n      }\n    }\n  }\n\n  pub(crate) fn convert_property_name(&mut self, property_name: &PropName) {\n    match property_name {\n      PropName::Computed(computed_property_name) => {\n        self.convert_expression(computed_property_name.expr.as_ref())\n      }","sourceCodeStart":702,"sourceCodeEnd":738,"githubUrl":"https://github.com/rollup/rollup/blob/ddc4ffab628944e45dbb8d66d58aae818015440f/rust/parse_ast/src/convert_ast/converter.rs#L702-L738","documentation":"convert_simple_assignment_target (converter.rs:700) has an unimplemented! arm at line 719 for SimpleAssignTarget::TsNonNull. This is the assignment-target form of TS's non-null assertion, e.g. `(x!) = value`. SWC parses it but the buffer format cannot represent it, so the converter panics. Assigning to a non-null-asserted expression is almost always a typo.","triggerScenarios":"Source contains an assignment whose left-hand side carries a non-null assertion, such as `(map.get(k)!) = v` or `(el!) = target`. The SimpleAssignTarget::TsNonNull node reaches convert_simple_assignment_target with no store arm.","commonSituations":"Misplaced `!` that turns a read into an assignment target. Generated/refactored code. Confusion between `!` (assertion) and a valid assignment target.","solutions":["Rewrite to assign to the underlying reference: `map.set(k, v);` or `el.value = target;`.","Add a TypeScript transform plugin so the `!` is stripped before parsing (then assign to the base).","Remove the stray `!` if it is unintended."],"exampleFix":"// before\n(map.get(k)!) = v;\n\n// after\nmap.set(k, v);","handlingStrategy":"validation","validationCode":"// Detect `(x!) =` style assignment targets.\nfunction hasTsNonNullAssignTarget(src) {\n  return /\\(\\s*[A-Za-z_$][\\w$]*\\s*!\\s*\\)\\s*=/.test(src);\n}\nif (hasTsNonNullAssignTarget(code)) {\n  throw new Error('`(x!) = value` is invalid; assign to the underlying reference.');\n}","typeGuard":null,"tryCatchPattern":"try {\n  await rollup({ input });\n} catch (err) {\n  if (String(err.message).includes('SimpleAssignTarget::TsNonNull')) {\n    throw new Error('A TS non-null assertion is used as an assignment target; rewrite the statement.');\n  }\n  throw err;\n}","preventionTips":["Never use `!` on the left-hand side of an assignment.","Add a TS transform plugin so `!` is stripped before parsing.","Treat a `!`-target as a typo and fix the real assignment."],"tags":["typescript","ast","native-parser","assignment"],"analyzedSha":"ddc4ffab628944e45dbb8d66d58aae818015440f","analyzedAt":"2026-08-03T19:42:57.546Z","schemaVersion":2}