fix(isolated-declarations): infer BigInt number as bigint type (#3806)

This commit is contained in:
Dunqing 2024-06-21 10:20:13 +00:00
parent 4e241fcda8
commit d8ecce5b3c

View file

@ -18,9 +18,8 @@ impl<'a> IsolatedDeclarations<'a> {
match expr {
Expression::BooleanLiteral(_) => Some(self.ast.ts_boolean_keyword(SPAN)),
Expression::NullLiteral(_) => Some(self.ast.ts_null_keyword(SPAN)),
Expression::NumericLiteral(_) | Expression::BigintLiteral(_) => {
Some(self.ast.ts_number_keyword(SPAN))
}
Expression::NumericLiteral(_) => Some(self.ast.ts_number_keyword(SPAN)),
Expression::BigintLiteral(_) => Some(self.ast.ts_bigint_keyword(SPAN)),
Expression::StringLiteral(_) => Some(self.ast.ts_string_keyword(SPAN)),
Expression::TemplateLiteral(lit) => {
if lit.expressions.is_empty() {