Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions crates/oxc_isolated_declarations/src/class.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,12 @@ impl<'a> IsolatedDeclarations<'a> {
let mut elements = self.ast.new_vec();
for (index, param) in function.params.items.iter().enumerate() {
if param.accessibility.is_some() || param.readonly {
// transformed params will definitely have type annotation
let type_annotation = self.ast.copy(&params.items[index].pattern.type_annotation);
let type_annotation = if param.accessibility.is_some_and(|a| a.is_private()) {
None
} else {
// transformed params will definitely have type annotation
self.ast.copy(&params.items[index].pattern.type_annotation)
};
if let Some(new_element) =
self.transform_formal_parameter_to_class_property(param, type_annotation)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export declare class Baz {
}
export declare class Boo {
readonly prop: number;
private readonly prop2: number;
private readonly prop2;
readonly prop3: number;
constructor(prop?: number, prop2?: number, prop3?: number);
}