From d8ecce5b3c989be182f59bdc7c6f9f55697768bf Mon Sep 17 00:00:00 2001 From: Dunqing <29533304+Dunqing@users.noreply.github.com> Date: Fri, 21 Jun 2024 10:20:13 +0000 Subject: [PATCH] fix(isolated-declarations): infer BigInt number as `bigint` type (#3806) --- crates/oxc_isolated_declarations/src/inferrer.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/crates/oxc_isolated_declarations/src/inferrer.rs b/crates/oxc_isolated_declarations/src/inferrer.rs index 12d562afc0f84..b631ed334fcaa 100644 --- a/crates/oxc_isolated_declarations/src/inferrer.rs +++ b/crates/oxc_isolated_declarations/src/inferrer.rs @@ -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() {