File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
crates/oxc_isolated_declarations Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -241,8 +241,12 @@ impl<'a> IsolatedDeclarations<'a> {
241241 let mut elements = self . ast . new_vec ( ) ;
242242 for ( index, param) in function. params . items . iter ( ) . enumerate ( ) {
243243 if param. accessibility . is_some ( ) || param. readonly {
244- // transformed params will definitely have type annotation
245- let type_annotation = self . ast . copy ( & params. items [ index] . pattern . type_annotation ) ;
244+ let type_annotation = if param. accessibility . is_some_and ( |a| a. is_private ( ) ) {
245+ None
246+ } else {
247+ // transformed params will definitely have type annotation
248+ self . ast . copy ( & params. items [ index] . pattern . type_annotation )
249+ } ;
246250 if let Some ( new_element) =
247251 self . transform_formal_parameter_to_class_property ( param, type_annotation)
248252 {
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ export declare class Baz {
2929}
3030export declare class Boo {
3131 readonly prop: number ;
32- private readonly prop2: number ;
32+ private readonly prop2 ;
3333 readonly prop3: number ;
3434 constructor (prop ? : number , prop2 ? : number , prop3 ? : number );
3535}
You can’t perform that action at this time.
0 commit comments