mirror of
https://github.com/danbulant/oxc
synced 2026-05-19 20:28:58 +00:00
fix(isolated-declarations): cannot infer nested as const (#3807)
This commit is contained in:
parent
d8ecce5b3c
commit
cb8a272392
1 changed files with 7 additions and 0 deletions
|
|
@ -205,6 +205,13 @@ impl<'a> IsolatedDeclarations<'a> {
|
|||
Expression::ArrowFunctionExpression(func) => {
|
||||
self.transform_arrow_function_to_ts_type(func)
|
||||
}
|
||||
Expression::TSAsExpression(expr) => {
|
||||
if expr.type_annotation.is_const_type_reference() {
|
||||
self.transform_expression_to_ts_type(&expr.expression)
|
||||
} else {
|
||||
Some(self.ast.copy(&expr.type_annotation))
|
||||
}
|
||||
}
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue