Skip to content

No SymbolId for declare class C {} #7278

@overlookmotel

Description

Semantic does not produce a SymbolId for C in declare class C {}.

I believe it should - all BindingIdentifiers should have a SymbolId, and we do produce SymbolIds for other TS-only identifiers e.g. type N = number;.

In this example, only A gets assigned a SymbolId:

class A {}
declare class B {}
export declare class C {}

Playground

Relevant code:

fn bind(&self, builder: &mut SemanticBuilder) {
if !self.declare {
let Some(ident) = &self.id else { return };
let symbol_id = builder.declare_symbol(
ident.span,
&ident.name,
SymbolFlags::Class,
if self.is_declaration() {
SymbolFlags::ClassExcludes
} else {
SymbolFlags::empty()
},
);
ident.symbol_id.set(Some(symbol_id));
}
}

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions