-
-
Notifications
You must be signed in to change notification settings - Fork 931
Closed
Closed
Copy link
Description
Came across this in #4884:
| let id = ctx.ast.binding_pattern(id, None::<TSTypeAnnotation<'_>>, false); |
And also:
oxc/crates/oxc_minifier/src/keep_var.rs
Lines 60 to 61 in 1e6d0fe
| let id = | |
| self.ast.binding_pattern::<Option<TSTypeAnnotation>>(binding_kind, None, false); |
Is there any way to avoid need for type annotations when the param is None?
I tried changing binding_pattern to:
pub fn binding_pattern<T1>(
self,
kind: BindingPatternKind<'a>,
type_annotation: Option<T1>,
optional: bool,
) -> BindingPattern<'a>
where
T1: IntoIn<'a, Box<'a, TSTypeAnnotation<'a>>>,
{
BindingPattern {
kind,
type_annotation: type_annotation.map(|it| it.into_in(self.allocator)),
optional
}
}But that doesn't help.
Is there anything we can do to avoid the need for type annotation on None?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Type
Fields
Give feedbackPriority
None yet