@@ -3038,13 +3038,19 @@ fn find_parent_class_no_fn_boundary(node: &Node, source: &[u8]) -> Option<String
30383038
30393039/// Wrapper node kinds that can sit between a dynamic `import()` call and its
30403040/// enclosing `variable_declarator` without changing which value gets bound —
3041- /// `await`, redundant parentheses, and TypeScript `as` casts. Real-world call
3042- /// sites often combine several of these, e.g.
3041+ /// `await`, redundant parentheses, and TypeScript `as`/`satisfies` casts.
3042+ /// Real-world call sites often combine several of these, e.g.
30433043/// `const { X } = (await import('./mod.js')) as { X: Fn }` nests
30443044/// await_expression → parenthesized_expression → as_expression before
3045- /// reaching the declarator (#1781).
3046- const DYNAMIC_IMPORT_WRAPPER_KINDS : & [ & str ] =
3047- & [ "await_expression" , "parenthesized_expression" , "as_expression" ] ;
3045+ /// reaching the declarator (#1781). `satisfies_expression` (TS 4.9+
3046+ /// `... satisfies { X: Fn }`) is structurally identical to `as_expression`
3047+ /// here — Greptile follow-up, mirrors the TS extractor.
3048+ const DYNAMIC_IMPORT_WRAPPER_KINDS : & [ & str ] = & [
3049+ "await_expression" ,
3050+ "parenthesized_expression" ,
3051+ "as_expression" ,
3052+ "satisfies_expression" ,
3053+ ] ;
30483054
30493055/// Extract named bindings from a dynamic `import()` call expression.
30503056/// Handles: `const { a, b } = await import(...)`, `const mod = await import(...)`,
@@ -4247,6 +4253,17 @@ mod tests {
42474253 assert ! ( dyn_imports[ 0 ] . names. contains( & "b" . to_string( ) ) ) ;
42484254 }
42494255
4256+ #[ test]
4257+ fn finds_dynamic_import_with_satisfies_cast_destructuring ( ) {
4258+ // TS 4.9+ `satisfies` is structurally identical to `as` here (Greptile
4259+ // follow-up to #1781) — same walk-up gap would otherwise reproduce.
4260+ let s = parse_ts ( "const { a, b } = await import('./foo.js') satisfies { a: Fn; b: Fn };" ) ;
4261+ let dyn_imports: Vec < _ > = s. imports . iter ( ) . filter ( |i| i. dynamic_import == Some ( true ) ) . collect ( ) ;
4262+ assert_eq ! ( dyn_imports. len( ) , 1 ) ;
4263+ assert ! ( dyn_imports[ 0 ] . names. contains( & "a" . to_string( ) ) ) ;
4264+ assert ! ( dyn_imports[ 0 ] . names. contains( & "b" . to_string( ) ) ) ;
4265+ }
4266+
42504267 #[ test]
42514268 fn finds_dynamic_import_with_parenthesized_as_cast_destructuring ( ) {
42524269 // Exact repro shape from #1781 (native-orchestrator.ts):
0 commit comments