Fixing self import (#58718)

This commit is contained in:
navya9singh
2024-05-30 15:02:43 -07:00
committed by GitHub
parent bbfc1aa281
commit 59e6620260
3 changed files with 311 additions and 1 deletions

View File

@@ -1149,7 +1149,7 @@ export function getExistingLocals(sourceFile: SourceFile, statements: readonly S
for (const statement of statements) {
forEachReference(statement, checker, s => {
const symbol = skipAlias(s, checker);
if (symbol.valueDeclaration && getSourceFileOfNode(symbol.valueDeclaration) === sourceFile) {
if (symbol.valueDeclaration && getSourceFileOfNode(symbol.valueDeclaration).path === sourceFile.path) {
existingLocals.add(symbol);
}
});