Skip to content

Commit 47f26f7

Browse files
committed
Remove notes
1 parent ecf20fe commit 47f26f7

5 files changed

+38
-170
lines changed

tests/baselines/reference/checkOrderDependenceGenericAssignability.errors.txt

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,11 @@
1-
tests/cases/compiler/checkOrderDependenceGenericAssignability.ts(46,7): error TS2322: Type 'Parent<unknown>' is not assignable to type 'Parent<string>'.
1+
tests/cases/compiler/checkOrderDependenceGenericAssignability.ts(24,7): error TS2322: Type 'Parent<unknown>' is not assignable to type 'Parent<string>'.
22
Types of property 'child' are incompatible.
33
Type 'Child<unknown, unknown>' is not assignable to type 'Child<string, unknown>'.
44
Type 'unknown' is not assignable to type 'string'.
55

66

77
==== tests/cases/compiler/checkOrderDependenceGenericAssignability.ts (1 errors) ====
8-
/*
9-
10-
Debugging notes: variance measurement for `Parent` is getting set to
11-
`VarianceFlags.Independent`, implying that its type parameter is never
12-
witnessed at all. It arrived at this conclusion by checking the assignability
13-
of `Parent` instantiated with marker types. It first checks assignability in
14-
both directions with instantiations with super/sub-related marker types, and
15-
assignability appears to return true in both directions; however, it actually
16-
is returning `Ternary.Unknown`, due to being unable to answer questions about
17-
the assignability of the types' `parent` and `child` properties without knowing
18-
their variances. After (incorrectly) concluding that `Parent` is bivariant on `A`,
19-
it checks another set of instantiations with markers that are unrelated to each
20-
other. That too comes back as `Ternary.Unknown` but is interpreted as true, so
21-
the variance gets updated to `Independent`, since instantiating `Parent` with
22-
all kinds of different markers with different assignability to each other
23-
apparently had no effect on the instantiations' assignability to each other.
24-
25-
I'm not sure if any of those comparisons ever actually looked at `a` and `b`,
26-
which should provide some non-recursive concrete variance information. I'm also
27-
not sure if `outofbandVarianceMarkerHandler` should have been called at some point,
28-
but it was not.
29-
30-
*/
8+
// #44572
319

3210
interface Parent<A> {
3311
child: Child<A> | null;

tests/baselines/reference/checkOrderDependenceGenericAssignability.js

Lines changed: 2 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,5 @@
11
//// [checkOrderDependenceGenericAssignability.ts]
2-
/*
3-
4-
Debugging notes: variance measurement for `Parent` is getting set to
5-
`VarianceFlags.Independent`, implying that its type parameter is never
6-
witnessed at all. It arrived at this conclusion by checking the assignability
7-
of `Parent` instantiated with marker types. It first checks assignability in
8-
both directions with instantiations with super/sub-related marker types, and
9-
assignability appears to return true in both directions; however, it actually
10-
is returning `Ternary.Unknown`, due to being unable to answer questions about
11-
the assignability of the types' `parent` and `child` properties without knowing
12-
their variances. After (incorrectly) concluding that `Parent` is bivariant on `A`,
13-
it checks another set of instantiations with markers that are unrelated to each
14-
other. That too comes back as `Ternary.Unknown` but is interpreted as true, so
15-
the variance gets updated to `Independent`, since instantiating `Parent` with
16-
all kinds of different markers with different assignability to each other
17-
apparently had no effect on the instantiations' assignability to each other.
18-
19-
I'm not sure if any of those comparisons ever actually looked at `a` and `b`,
20-
which should provide some non-recursive concrete variance information. I'm also
21-
not sure if `outofbandVarianceMarkerHandler` should have been called at some point,
22-
but it was not.
23-
24-
*/
2+
// #44572
253

264
interface Parent<A> {
275
child: Child<A> | null;
@@ -48,29 +26,7 @@ const notString: Parent<string> = pu;
4826

4927

5028
//// [checkOrderDependenceGenericAssignability.js]
51-
/*
52-
53-
Debugging notes: variance measurement for `Parent` is getting set to
54-
`VarianceFlags.Independent`, implying that its type parameter is never
55-
witnessed at all. It arrived at this conclusion by checking the assignability
56-
of `Parent` instantiated with marker types. It first checks assignability in
57-
both directions with instantiations with super/sub-related marker types, and
58-
assignability appears to return true in both directions; however, it actually
59-
is returning `Ternary.Unknown`, due to being unable to answer questions about
60-
the assignability of the types' `parent` and `child` properties without knowing
61-
their variances. After (incorrectly) concluding that `Parent` is bivariant on `A`,
62-
it checks another set of instantiations with markers that are unrelated to each
63-
other. That too comes back as `Ternary.Unknown` but is interpreted as true, so
64-
the variance gets updated to `Independent`, since instantiating `Parent` with
65-
all kinds of different markers with different assignability to each other
66-
apparently had no effect on the instantiations' assignability to each other.
67-
68-
I'm not sure if any of those comparisons ever actually looked at `a` and `b`,
69-
which should provide some non-recursive concrete variance information. I'm also
70-
not sure if `outofbandVarianceMarkerHandler` should have been called at some point,
71-
but it was not.
72-
73-
*/
29+
// #44572
7430
function fn(inp) {
7531
// This assignability check defeats the later one
7632
var a = inp;
Lines changed: 32 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,89 +1,67 @@
11
=== tests/cases/compiler/checkOrderDependenceGenericAssignability.ts ===
2-
/*
3-
4-
Debugging notes: variance measurement for `Parent` is getting set to
5-
`VarianceFlags.Independent`, implying that its type parameter is never
6-
witnessed at all. It arrived at this conclusion by checking the assignability
7-
of `Parent` instantiated with marker types. It first checks assignability in
8-
both directions with instantiations with super/sub-related marker types, and
9-
assignability appears to return true in both directions; however, it actually
10-
is returning `Ternary.Unknown`, due to being unable to answer questions about
11-
the assignability of the types' `parent` and `child` properties without knowing
12-
their variances. After (incorrectly) concluding that `Parent` is bivariant on `A`,
13-
it checks another set of instantiations with markers that are unrelated to each
14-
other. That too comes back as `Ternary.Unknown` but is interpreted as true, so
15-
the variance gets updated to `Independent`, since instantiating `Parent` with
16-
all kinds of different markers with different assignability to each other
17-
apparently had no effect on the instantiations' assignability to each other.
18-
19-
I'm not sure if any of those comparisons ever actually looked at `a` and `b`,
20-
which should provide some non-recursive concrete variance information. I'm also
21-
not sure if `outofbandVarianceMarkerHandler` should have been called at some point,
22-
but it was not.
23-
24-
*/
2+
// #44572
253

264
interface Parent<A> {
275
>Parent : Symbol(Parent, Decl(checkOrderDependenceGenericAssignability.ts, 0, 0))
28-
>A : Symbol(A, Decl(checkOrderDependenceGenericAssignability.ts, 24, 17))
6+
>A : Symbol(A, Decl(checkOrderDependenceGenericAssignability.ts, 2, 17))
297

308
child: Child<A> | null;
31-
>child : Symbol(Parent.child, Decl(checkOrderDependenceGenericAssignability.ts, 24, 21))
32-
>Child : Symbol(Child, Decl(checkOrderDependenceGenericAssignability.ts, 27, 1))
33-
>A : Symbol(A, Decl(checkOrderDependenceGenericAssignability.ts, 24, 17))
9+
>child : Symbol(Parent.child, Decl(checkOrderDependenceGenericAssignability.ts, 2, 21))
10+
>Child : Symbol(Child, Decl(checkOrderDependenceGenericAssignability.ts, 5, 1))
11+
>A : Symbol(A, Decl(checkOrderDependenceGenericAssignability.ts, 2, 17))
3412

3513
parent: Parent<A> | null;
36-
>parent : Symbol(Parent.parent, Decl(checkOrderDependenceGenericAssignability.ts, 25, 25))
14+
>parent : Symbol(Parent.parent, Decl(checkOrderDependenceGenericAssignability.ts, 3, 25))
3715
>Parent : Symbol(Parent, Decl(checkOrderDependenceGenericAssignability.ts, 0, 0))
38-
>A : Symbol(A, Decl(checkOrderDependenceGenericAssignability.ts, 24, 17))
16+
>A : Symbol(A, Decl(checkOrderDependenceGenericAssignability.ts, 2, 17))
3917
}
4018

4119
interface Child<A, B = unknown> extends Parent<A> {
42-
>Child : Symbol(Child, Decl(checkOrderDependenceGenericAssignability.ts, 27, 1))
43-
>A : Symbol(A, Decl(checkOrderDependenceGenericAssignability.ts, 29, 16))
44-
>B : Symbol(B, Decl(checkOrderDependenceGenericAssignability.ts, 29, 18))
20+
>Child : Symbol(Child, Decl(checkOrderDependenceGenericAssignability.ts, 5, 1))
21+
>A : Symbol(A, Decl(checkOrderDependenceGenericAssignability.ts, 7, 16))
22+
>B : Symbol(B, Decl(checkOrderDependenceGenericAssignability.ts, 7, 18))
4523
>Parent : Symbol(Parent, Decl(checkOrderDependenceGenericAssignability.ts, 0, 0))
46-
>A : Symbol(A, Decl(checkOrderDependenceGenericAssignability.ts, 29, 16))
24+
>A : Symbol(A, Decl(checkOrderDependenceGenericAssignability.ts, 7, 16))
4725

4826
readonly a: A;
49-
>a : Symbol(Child.a, Decl(checkOrderDependenceGenericAssignability.ts, 29, 51))
50-
>A : Symbol(A, Decl(checkOrderDependenceGenericAssignability.ts, 29, 16))
27+
>a : Symbol(Child.a, Decl(checkOrderDependenceGenericAssignability.ts, 7, 51))
28+
>A : Symbol(A, Decl(checkOrderDependenceGenericAssignability.ts, 7, 16))
5129

5230
// This field isn't necessary to the repro, but the
5331
// type parameter is, so including it
5432
readonly b: B;
55-
>b : Symbol(Child.b, Decl(checkOrderDependenceGenericAssignability.ts, 30, 16))
56-
>B : Symbol(B, Decl(checkOrderDependenceGenericAssignability.ts, 29, 18))
33+
>b : Symbol(Child.b, Decl(checkOrderDependenceGenericAssignability.ts, 8, 16))
34+
>B : Symbol(B, Decl(checkOrderDependenceGenericAssignability.ts, 7, 18))
5735
}
5836

5937
function fn<A>(inp: Child<A>) {
60-
>fn : Symbol(fn, Decl(checkOrderDependenceGenericAssignability.ts, 34, 1))
61-
>A : Symbol(A, Decl(checkOrderDependenceGenericAssignability.ts, 36, 12))
62-
>inp : Symbol(inp, Decl(checkOrderDependenceGenericAssignability.ts, 36, 15))
63-
>Child : Symbol(Child, Decl(checkOrderDependenceGenericAssignability.ts, 27, 1))
64-
>A : Symbol(A, Decl(checkOrderDependenceGenericAssignability.ts, 36, 12))
38+
>fn : Symbol(fn, Decl(checkOrderDependenceGenericAssignability.ts, 12, 1))
39+
>A : Symbol(A, Decl(checkOrderDependenceGenericAssignability.ts, 14, 12))
40+
>inp : Symbol(inp, Decl(checkOrderDependenceGenericAssignability.ts, 14, 15))
41+
>Child : Symbol(Child, Decl(checkOrderDependenceGenericAssignability.ts, 5, 1))
42+
>A : Symbol(A, Decl(checkOrderDependenceGenericAssignability.ts, 14, 12))
6543

6644
// This assignability check defeats the later one
6745
const a: Child<unknown> = inp;
68-
>a : Symbol(a, Decl(checkOrderDependenceGenericAssignability.ts, 38, 7))
69-
>Child : Symbol(Child, Decl(checkOrderDependenceGenericAssignability.ts, 27, 1))
70-
>inp : Symbol(inp, Decl(checkOrderDependenceGenericAssignability.ts, 36, 15))
46+
>a : Symbol(a, Decl(checkOrderDependenceGenericAssignability.ts, 16, 7))
47+
>Child : Symbol(Child, Decl(checkOrderDependenceGenericAssignability.ts, 5, 1))
48+
>inp : Symbol(inp, Decl(checkOrderDependenceGenericAssignability.ts, 14, 15))
7149
}
7250

7351
// Allowed initialization of pu
7452
const pu: Parent<unknown> = { child: { a: 0, b: 0, child: null, parent: null }, parent: null };
75-
>pu : Symbol(pu, Decl(checkOrderDependenceGenericAssignability.ts, 42, 5))
53+
>pu : Symbol(pu, Decl(checkOrderDependenceGenericAssignability.ts, 20, 5))
7654
>Parent : Symbol(Parent, Decl(checkOrderDependenceGenericAssignability.ts, 0, 0))
77-
>child : Symbol(child, Decl(checkOrderDependenceGenericAssignability.ts, 42, 29))
78-
>a : Symbol(a, Decl(checkOrderDependenceGenericAssignability.ts, 42, 38))
79-
>b : Symbol(b, Decl(checkOrderDependenceGenericAssignability.ts, 42, 44))
80-
>child : Symbol(child, Decl(checkOrderDependenceGenericAssignability.ts, 42, 50))
81-
>parent : Symbol(parent, Decl(checkOrderDependenceGenericAssignability.ts, 42, 63))
82-
>parent : Symbol(parent, Decl(checkOrderDependenceGenericAssignability.ts, 42, 79))
55+
>child : Symbol(child, Decl(checkOrderDependenceGenericAssignability.ts, 20, 29))
56+
>a : Symbol(a, Decl(checkOrderDependenceGenericAssignability.ts, 20, 38))
57+
>b : Symbol(b, Decl(checkOrderDependenceGenericAssignability.ts, 20, 44))
58+
>child : Symbol(child, Decl(checkOrderDependenceGenericAssignability.ts, 20, 50))
59+
>parent : Symbol(parent, Decl(checkOrderDependenceGenericAssignability.ts, 20, 63))
60+
>parent : Symbol(parent, Decl(checkOrderDependenceGenericAssignability.ts, 20, 79))
8361

8462
// Should error
8563
const notString: Parent<string> = pu;
86-
>notString : Symbol(notString, Decl(checkOrderDependenceGenericAssignability.ts, 45, 5))
64+
>notString : Symbol(notString, Decl(checkOrderDependenceGenericAssignability.ts, 23, 5))
8765
>Parent : Symbol(Parent, Decl(checkOrderDependenceGenericAssignability.ts, 0, 0))
88-
>pu : Symbol(pu, Decl(checkOrderDependenceGenericAssignability.ts, 42, 5))
66+
>pu : Symbol(pu, Decl(checkOrderDependenceGenericAssignability.ts, 20, 5))
8967

tests/baselines/reference/checkOrderDependenceGenericAssignability.types

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,5 @@
11
=== tests/cases/compiler/checkOrderDependenceGenericAssignability.ts ===
2-
/*
3-
4-
Debugging notes: variance measurement for `Parent` is getting set to
5-
`VarianceFlags.Independent`, implying that its type parameter is never
6-
witnessed at all. It arrived at this conclusion by checking the assignability
7-
of `Parent` instantiated with marker types. It first checks assignability in
8-
both directions with instantiations with super/sub-related marker types, and
9-
assignability appears to return true in both directions; however, it actually
10-
is returning `Ternary.Unknown`, due to being unable to answer questions about
11-
the assignability of the types' `parent` and `child` properties without knowing
12-
their variances. After (incorrectly) concluding that `Parent` is bivariant on `A`,
13-
it checks another set of instantiations with markers that are unrelated to each
14-
other. That too comes back as `Ternary.Unknown` but is interpreted as true, so
15-
the variance gets updated to `Independent`, since instantiating `Parent` with
16-
all kinds of different markers with different assignability to each other
17-
apparently had no effect on the instantiations' assignability to each other.
18-
19-
I'm not sure if any of those comparisons ever actually looked at `a` and `b`,
20-
which should provide some non-recursive concrete variance information. I'm also
21-
not sure if `outofbandVarianceMarkerHandler` should have been called at some point,
22-
but it was not.
23-
24-
*/
2+
// #44572
253

264
interface Parent<A> {
275
child: Child<A> | null;

tests/cases/compiler/checkOrderDependenceGenericAssignability.ts

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,4 @@
1-
/*
2-
3-
Debugging notes: variance measurement for `Parent` is getting set to
4-
`VarianceFlags.Independent`, implying that its type parameter is never
5-
witnessed at all. It arrived at this conclusion by checking the assignability
6-
of `Parent` instantiated with marker types. It first checks assignability in
7-
both directions with instantiations with super/sub-related marker types, and
8-
assignability appears to return true in both directions; however, it actually
9-
is returning `Ternary.Unknown`, due to being unable to answer questions about
10-
the assignability of the types' `parent` and `child` properties without knowing
11-
their variances. After (incorrectly) concluding that `Parent` is bivariant on `A`,
12-
it checks another set of instantiations with markers that are unrelated to each
13-
other. That too comes back as `Ternary.Unknown` but is interpreted as true, so
14-
the variance gets updated to `Independent`, since instantiating `Parent` with
15-
all kinds of different markers with different assignability to each other
16-
apparently had no effect on the instantiations' assignability to each other.
17-
18-
I'm not sure if any of those comparisons ever actually looked at `a` and `b`,
19-
which should provide some non-recursive concrete variance information. I'm also
20-
not sure if `outofbandVarianceMarkerHandler` should have been called at some point,
21-
but it was not.
22-
23-
*/
1+
// #44572
242

253
interface Parent<A> {
264
child: Child<A> | null;

0 commit comments

Comments
 (0)