File tree Expand file tree Collapse file tree
crates/oxc_isolated_declarations Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -52,16 +52,15 @@ impl<'a> IsolatedDeclarations<'a> {
5252 self . error ( inferred_type_of_class_expression ( expr. span ) ) ;
5353 Some ( self . ast . ts_unknown_keyword ( SPAN ) )
5454 }
55+ Expression :: ParenthesizedExpression ( expr) => {
56+ self . infer_type_from_expression ( & expr. expression )
57+ }
5558 Expression :: TSNonNullExpression ( expr) => {
5659 self . infer_type_from_expression ( & expr. expression )
5760 }
5861 Expression :: TSSatisfiesExpression ( expr) => {
5962 self . infer_type_from_expression ( & expr. expression )
6063 }
61- Expression :: TSInstantiationExpression ( _expr) => {
62- unreachable ! ( ) ;
63- // infer_type_from_expression(ctx, &expr.expression)
64- }
6564 Expression :: TSTypeAssertion ( expr) => Some ( self . ast . copy ( & expr. type_annotation ) ) ,
6665 _ => None ,
6766 }
Original file line number Diff line number Diff line change 1+ // ParenthesizedExpression
2+ const n = ( 0 ) ;
3+ const s = ( "" ) ;
4+ const t = ( `` ) ;
5+ const b = ( true ) ;
Original file line number Diff line number Diff line change 1+ -- -
2+ source : crates / oxc_isolated_declarations / tests / mod .rs
3+ input_file : crates / oxc_isolated_declarations / tests / fixtures / infer - expression .ts
4+ -- -
5+ ==================== .D .TS ====================
6+
7+ declare const n: number ;
8+ declare const s: string ;
9+ declare const t: string ;
10+ declare const b: boolean ;
You can’t perform that action at this time.
0 commit comments