Skip to content

Commit b445f90

Browse files
author
Arthur Ozga
committed
Merge branch 'contextSensitiveIsRelatedTo' into abstract-classes2
2 parents d932618 + e47e5bc commit b445f90

2 files changed

Lines changed: 12 additions & 9 deletions

File tree

src/compiler/checker.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4329,7 +4329,7 @@ namespace ts {
43294329
* @param relationFlags Additional information affecting whether the relation holds. Currently used only for distinguishing
43304330
* between a type comparison when extending classes from other comparisons of the constructor types.
43314331
*
4332-
* Caution: checks triggered by these flags should NOT affect the result re
4332+
* Caution: checks triggered by these flags should NOT affect the result cached.
43334333
* @param errorNode The node upon which all errors will be reported, if defined.
43344334
* @param headMessage If the error chain should be prepended by a head message, then headMessage will be used.
43354335
* @param containingMessageChain A chain of errors to prepend any new errors found.
@@ -4388,6 +4388,7 @@ namespace ts {
43884388
// Ternary.False if they are not related.
43894389
function isRelatedTo(source: Type, target: Type, reportErrors?: boolean, headMessage?: DiagnosticMessage): Ternary {
43904390
let result: Ternary;
4391+
let relationFlagCheckResult: Ternary;
43914392
// both types are the same - covers 'they are the same primitive type or both are Any' or the same type parameter cases
43924393
if (source === target) return Ternary.True;
43934394
if (relation !== identityRelation) {

src/compiler/core.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,19 @@
22

33
/* @internal */
44
namespace ts {
5-
// Ternary values are defined such that
6-
// x & y is False if either x or y is False.
7-
// x & y is Maybe if either x or y is Maybe, but neither x or y is False.
8-
// x & y is True if both x and y are True.
9-
// x | y is False if both x and y are False.
10-
// x | y is Maybe if either x or y is Maybe, but neither x or y is True.
11-
// x | y is True if either x or y is True.
5+
/**
6+
* Ternary values are defined such that
7+
* x & y is False if either x or y is False.
8+
* x & y is Maybe if either x or y is Maybe, but neither x or y is False.
9+
* x & y is True if both x and y are True.
10+
* x | y is False if both x and y are False.
11+
* x | y is Maybe if either x or y is Maybe, but neither x or y is True.
12+
* x | y is True if either x or y is True.
13+
*/
1214
export const enum Ternary {
1315
False = 0,
1416
Maybe = 1,
15-
True = -1
17+
True = -1
1618
}
1719

1820
export function createFileMap<T>(getCanonicalFileName: (fileName: string) => string): FileMap<T> {

0 commit comments

Comments
 (0)