Skip to content

Commit d7d0735

Browse files
committed
refactor(semantic): remove SymbolFlags::TypeLiteral (#7415)
1 parent 79ab8cc commit d7d0735

2 files changed

Lines changed: 7 additions & 10 deletions

File tree

crates/oxc_linter/src/rules/eslint/no_unused_vars/usage.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,8 @@ impl<'s, 'a> Symbol<'s, 'a> {
3030
const IMPORT: SymbolFlags = SymbolFlags::Import.union(SymbolFlags::TypeImport);
3131
// note: intetionally do not use `SymbolFlags::is_type` here, since that
3232
// can return `true` for values
33-
const TYPE: SymbolFlags = SymbolFlags::TypeAlias
34-
.union(SymbolFlags::TypeLiteral)
35-
.union(SymbolFlags::TypeParameter)
36-
.union(SymbolFlags::Interface);
33+
const TYPE: SymbolFlags =
34+
SymbolFlags::TypeAlias.union(SymbolFlags::TypeParameter).union(SymbolFlags::Interface);
3735
const ENUM: SymbolFlags = SymbolFlags::Enum.union(SymbolFlags::EnumMember);
3836
const NAMESPACE_LIKE: SymbolFlags =
3937
SymbolFlags::NameSpaceModule.union(SymbolFlags::ValueModule);

crates/oxc_syntax/src/symbol.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,20 +91,19 @@ bitflags! {
9191
const RegularEnum = 1 << 10;
9292
const ConstEnum = 1 << 11;
9393
const EnumMember = 1 << 12;
94-
const TypeLiteral = 1 << 13;
95-
const TypeParameter = 1 << 14;
96-
const NameSpaceModule = 1 << 15;
97-
const ValueModule = 1 << 16;
94+
const TypeParameter = 1 << 13;
95+
const NameSpaceModule = 1 << 14;
96+
const ValueModule = 1 << 15;
9897
// In a dts file or there is a declare flag
99-
const Ambient = 1 << 17;
98+
const Ambient = 1 << 16;
10099

101100
const Enum = Self::ConstEnum.bits() | Self::RegularEnum.bits();
102101
const Variable = Self::FunctionScopedVariable.bits() | Self::BlockScopedVariable.bits();
103102

104103
const BlockScoped = Self::BlockScopedVariable.bits() | Self::Enum.bits() | Self::Class.bits();
105104

106105
const Value = Self::Variable.bits() | Self::Class.bits() | Self::Enum.bits() | Self::EnumMember.bits() | Self::ValueModule.bits();
107-
const Type = Self::Class.bits() | Self::Interface.bits() | Self::Enum.bits() | Self::EnumMember.bits() | Self::TypeLiteral.bits() | Self::TypeParameter.bits() | Self::TypeAlias.bits();
106+
const Type = Self::Class.bits() | Self::Interface.bits() | Self::Enum.bits() | Self::EnumMember.bits() | Self::TypeParameter.bits() | Self::TypeAlias.bits();
108107

109108
/// Variables can be redeclared, but can not redeclare a block-scoped declaration with the
110109
/// same name, or any other value that is not a variable, e.g. ValueModule or Class

0 commit comments

Comments
 (0)