Skip to content

Commit cb8a272

Browse files
committed
fix(isolated-declarations): cannot infer nested as const (#3807)
1 parent d8ecce5 commit cb8a272

File tree

1 file changed

+7
-0
lines changed
  • crates/oxc_isolated_declarations/src

1 file changed

+7
-0
lines changed

crates/oxc_isolated_declarations/src/types.rs

+7
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,13 @@ impl<'a> IsolatedDeclarations<'a> {
205205
Expression::ArrowFunctionExpression(func) => {
206206
self.transform_arrow_function_to_ts_type(func)
207207
}
208+
Expression::TSAsExpression(expr) => {
209+
if expr.type_annotation.is_const_type_reference() {
210+
self.transform_expression_to_ts_type(&expr.expression)
211+
} else {
212+
Some(self.ast.copy(&expr.type_annotation))
213+
}
214+
}
208215
_ => None,
209216
}
210217
}

0 commit comments

Comments
 (0)