Skip to content

Commit

Permalink
Revert "fix(parser): don't parse null as a literal type (oxc-project#…
Browse files Browse the repository at this point in the history
…2572)"

This reverts commit f9d34e2.
  • Loading branch information
a-rustacean committed Mar 4, 2024
1 parent a83a65f commit bdfe844
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions crates/oxc_parser/src/ts/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -397,8 +397,7 @@ impl<'a> ParserImpl<'a> {
Kind::Import => self.parse_ts_import_type(),
Kind::Minus if self.peek_kind().is_number() => self.parse_ts_literal_type(),
Kind::Question => self.parse_js_doc_unknown_or_nullable_type(),
// null should not be parsed as a literal type
kind if kind.is_literal() && kind != Kind::Null => self.parse_ts_literal_type(),
kind if kind.is_literal() => self.parse_ts_literal_type(),
_ => {
if !self.peek_at(Kind::Dot) {
let keyword = self.parse_ts_keyword_type();
Expand Down

0 comments on commit bdfe844

Please sign in to comment.