diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 590eceeb302..c3edfed4804 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -4329,7 +4329,7 @@ namespace ts { * @param relationFlags Additional information affecting whether the relation holds. Currently used only for distinguishing * between a type comparison when extending classes from other comparisons of the constructor types. * - * Caution: checks triggered by these flags should NOT affect the result re + * Caution: checks triggered by these flags should NOT affect the result cached. * @param errorNode The node upon which all errors will be reported, if defined. * @param headMessage If the error chain should be prepended by a head message, then headMessage will be used. * @param containingMessageChain A chain of errors to prepend any new errors found. @@ -4388,6 +4388,7 @@ namespace ts { // Ternary.False if they are not related. function isRelatedTo(source: Type, target: Type, reportErrors?: boolean, headMessage?: DiagnosticMessage): Ternary { let result: Ternary; + let relationFlagCheckResult: Ternary; // both types are the same - covers 'they are the same primitive type or both are Any' or the same type parameter cases if (source === target) return Ternary.True; if (relation !== identityRelation) { diff --git a/src/compiler/core.ts b/src/compiler/core.ts index 7b35c5e0d65..c3d2a00eba5 100644 --- a/src/compiler/core.ts +++ b/src/compiler/core.ts @@ -2,17 +2,19 @@ /* @internal */ namespace ts { - // Ternary values are defined such that - // x & y is False if either x or y is False. - // x & y is Maybe if either x or y is Maybe, but neither x or y is False. - // x & y is True if both x and y are True. - // x | y is False if both x and y are False. - // x | y is Maybe if either x or y is Maybe, but neither x or y is True. - // x | y is True if either x or y is True. + /** + * Ternary values are defined such that + * x & y is False if either x or y is False. + * x & y is Maybe if either x or y is Maybe, but neither x or y is False. + * x & y is True if both x and y are True. + * x | y is False if both x and y are False. + * x | y is Maybe if either x or y is Maybe, but neither x or y is True. + * x | y is True if either x or y is True. + */ export const enum Ternary { False = 0, Maybe = 1, - True = -1 + True = -1 } export function createFileMap(getCanonicalFileName: (fileName: string) => string): FileMap {