Skip to content

Commit

Permalink
fix(isolated-declarations): don't collect references when `ExportName…
Browse files Browse the repository at this point in the history
…dDeclaration` has source (#5926)
  • Loading branch information
Dunqing committed Sep 20, 2024
1 parent 756a571 commit b6a9178
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion crates/oxc_isolated_declarations/src/scope.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ impl<'a> Visit<'a> for ScopeTree<'a> {
fn visit_export_named_declaration(&mut self, decl: &ExportNamedDeclaration<'a>) {
if let Some(declaration) = &decl.declaration {
walk_declaration(self, declaration);
} else {
} else if decl.source.is_none() {
// export { ... }
for specifier in &decl.specifiers {
if let Some(name) = specifier.local.identifier_name() {
self.add_type_reference(name.clone());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ export const bar: (this: ThisType2) => void = function() {}
import { type InferType1, type InferType2 } from 'infer';

export type F<X extends InferType1> = X extends infer U extends InferType2 ? U : never

export { Unused } from './unused';
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ export declare function foo(this: ThisType1 ): void;
export declare const bar: (this: ThisType2 ) => void;
import { type InferType1, type InferType2 } from "infer";
export type F<X extends InferType1> = X extends infer U extends InferType2 ? U : never;
export { Unused } from "./unused";

0 comments on commit b6a9178

Please sign in to comment.