Skip to content

Commit

Permalink
Fix checker initialization crash
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewbranch committed Dec 1, 2021
1 parent 670ad45 commit 0612e18
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/compiler/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2122,7 +2122,7 @@ namespace ts {
}
}
if (!result) {
if (nameNotFoundMessage) {
if (nameNotFoundMessage && produceDiagnostics) {
if (!errorLocation ||
!checkAndReportErrorForMissingPrefix(errorLocation, name, nameArg!) && // TODO: GH#18217
!checkAndReportErrorForExtendingInterface(errorLocation) &&
Expand Down Expand Up @@ -2172,7 +2172,7 @@ namespace ts {
}

// Perform extra checks only if error reporting was requested
if (nameNotFoundMessage) {
if (nameNotFoundMessage && produceDiagnostics) {
if (propertyWithInvalidInitializer && !(getEmitScriptTarget(compilerOptions) === ScriptTarget.ESNext && useDefineForClassFields)) {
// We have a match, but the reference occurred within a property initializer and the identifier also binds
// to a local variable in the constructor where the code will be emitted. Note that this is actually allowed
Expand Down Expand Up @@ -28816,7 +28816,8 @@ namespace ts {
return candidateName;
}

if (candidate.flags & SymbolFlags.Alias) {
// Don't try to resolve aliases if global types aren't initialized yet
if (globalObjectType && candidate.flags & SymbolFlags.Alias) {
const alias = tryResolveAlias(candidate);
if (alias && alias.flags & meaning) {
return candidateName;
Expand Down

0 comments on commit 0612e18

Please sign in to comment.