Skip to content

Commit b5c0ec6

Browse files
committed
don't emit diagnostics when looking up referenced symbol
1 parent 589eb24 commit b5c0ec6

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

Diff for: src/compiler/checker.ts

+8-4
Original file line numberDiff line numberDiff line change
@@ -1837,8 +1837,9 @@ namespace ts {
18371837
nameArg: __String | Identifier | undefined,
18381838
isUse: boolean,
18391839
excludeGlobals = false,
1840-
getSpellingSuggstions = true): Symbol | undefined {
1841-
return resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, getSpellingSuggstions, getSymbol);
1840+
getSpellingSuggestions = true,
1841+
reportErrors = true): Symbol | undefined {
1842+
return resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, getSpellingSuggestions, getSymbol, reportErrors);
18421843
}
18431844

18441845
function resolveNameHelper(
@@ -2269,7 +2270,7 @@ namespace ts {
22692270
}
22702271

22712272
// Perform extra checks only if error reporting was requested
2272-
if (nameNotFoundMessage) {
2273+
if (reportErrors && nameNotFoundMessage) {
22732274
addLazyDiagnostic(() => {
22742275
// Only check for block-scoped variable if we have an error location and are looking for the
22752276
// name with variable meaning
@@ -43507,7 +43508,10 @@ namespace ts {
4350743508
SymbolFlags.Value | SymbolFlags.ExportValue | SymbolFlags.Alias,
4350843509
/*nodeNotFoundMessage*/ undefined,
4350943510
/*nameArg*/ undefined,
43510-
/*isUse*/ true);
43511+
/*isUse*/ true,
43512+
/*excludeGlobals*/ undefined,
43513+
/*getSpellingSuggestions*/ undefined,
43514+
/*reportErrors*/ false);
4351143515
}
4351243516

4351343517
function getReferencedValueDeclaration(referenceIn: Identifier): Declaration | undefined {

0 commit comments

Comments
 (0)