Skip to content

Commit c6f343e

Browse files
committed
Improve asserts in getSuggestionForNonexistentSymbol
1 parent 146addc commit c6f343e

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/compiler/checker.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15291,8 +15291,9 @@ namespace ts {
1529115291
}
1529215292

1529315293
function getSuggestionForNonexistentSymbol(location: Node, outerName: __String, meaning: SymbolFlags): string {
15294+
Debug.assert(outerName !== undefined, "outername should always be defined");
1529415295
const result = resolveNameHelper(location, outerName, meaning, /*nameNotFoundMessage*/ undefined, outerName, /*isUse*/ false, (symbols, name, meaning) => {
15295-
Debug.assert(name !== undefined, "name should always be defined, and equal to " + outerName);
15296+
Debug.assertEqual(outerName, name, "name should equal outerName");
1529615297
const symbol = getSymbol(symbols, name, meaning);
1529715298
// Sometimes the symbol is found when location is a return type of a function: `typeof x` and `x` is declared in the body of the function
1529815299
// So the table *contains* `x` but `x` isn't actually in scope.

0 commit comments

Comments
 (0)