mirror of
https://github.com/danbulant/oxc
synced 2026-05-19 20:28:58 +00:00
fix(semantic): TSExportAssignment cannot reference type binding (#4502)
close: #4488
This commit is contained in:
parent
2477330440
commit
36bb6805c6
2 changed files with 15 additions and 1 deletions
|
|
@ -1822,6 +1822,13 @@ impl<'a> SemanticBuilder<'a> {
|
|||
}
|
||||
}
|
||||
}
|
||||
AstKind::TSExportAssignment(export) => {
|
||||
// export = a;
|
||||
// ^ can reference value or type
|
||||
if export.expression.is_identifier_reference() {
|
||||
self.current_reference_flag = ReferenceFlag::Read | ReferenceFlag::Type;
|
||||
}
|
||||
}
|
||||
AstKind::IdentifierReference(ident) => {
|
||||
self.reference_identifier(ident);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,7 +22,14 @@ input_file: crates/oxc_semantic/tests/fixtures/typescript-eslint/export/equals3-
|
|||
"id": 0,
|
||||
"name": "Foo",
|
||||
"node": "TSInterfaceDeclaration",
|
||||
"references": []
|
||||
"references": [
|
||||
{
|
||||
"flag": "ReferenceFlag(Read | Type)",
|
||||
"id": 0,
|
||||
"name": "Foo",
|
||||
"node_id": 11
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue