1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115
|
=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithPrivates2.ts ===
// object types are identical structurally
class C<T> {
>C : Symbol(C, Decl(objectTypesIdentityWithPrivates2.ts, 0, 0))
>T : Symbol(T, Decl(objectTypesIdentityWithPrivates2.ts, 2, 8))
private foo: T;
>foo : Symbol(C.foo, Decl(objectTypesIdentityWithPrivates2.ts, 2, 12))
>T : Symbol(T, Decl(objectTypesIdentityWithPrivates2.ts, 2, 8))
}
class D<T> extends C<T> {
>D : Symbol(D, Decl(objectTypesIdentityWithPrivates2.ts, 4, 1))
>T : Symbol(T, Decl(objectTypesIdentityWithPrivates2.ts, 6, 8))
>C : Symbol(C, Decl(objectTypesIdentityWithPrivates2.ts, 0, 0))
>T : Symbol(T, Decl(objectTypesIdentityWithPrivates2.ts, 6, 8))
}
function foo1(x: C<string>);
>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithPrivates2.ts, 7, 1), Decl(objectTypesIdentityWithPrivates2.ts, 9, 28), Decl(objectTypesIdentityWithPrivates2.ts, 10, 28))
>x : Symbol(x, Decl(objectTypesIdentityWithPrivates2.ts, 9, 14))
>C : Symbol(C, Decl(objectTypesIdentityWithPrivates2.ts, 0, 0))
function foo1(x: C<number>); // ok
>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithPrivates2.ts, 7, 1), Decl(objectTypesIdentityWithPrivates2.ts, 9, 28), Decl(objectTypesIdentityWithPrivates2.ts, 10, 28))
>x : Symbol(x, Decl(objectTypesIdentityWithPrivates2.ts, 10, 14))
>C : Symbol(C, Decl(objectTypesIdentityWithPrivates2.ts, 0, 0))
function foo1(x: any) { }
>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithPrivates2.ts, 7, 1), Decl(objectTypesIdentityWithPrivates2.ts, 9, 28), Decl(objectTypesIdentityWithPrivates2.ts, 10, 28))
>x : Symbol(x, Decl(objectTypesIdentityWithPrivates2.ts, 11, 14))
function foo2(x: D<string>);
>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithPrivates2.ts, 11, 25), Decl(objectTypesIdentityWithPrivates2.ts, 13, 28), Decl(objectTypesIdentityWithPrivates2.ts, 14, 28))
>x : Symbol(x, Decl(objectTypesIdentityWithPrivates2.ts, 13, 14))
>D : Symbol(D, Decl(objectTypesIdentityWithPrivates2.ts, 4, 1))
function foo2(x: D<number>); // ok
>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithPrivates2.ts, 11, 25), Decl(objectTypesIdentityWithPrivates2.ts, 13, 28), Decl(objectTypesIdentityWithPrivates2.ts, 14, 28))
>x : Symbol(x, Decl(objectTypesIdentityWithPrivates2.ts, 14, 14))
>D : Symbol(D, Decl(objectTypesIdentityWithPrivates2.ts, 4, 1))
function foo2(x: any) { }
>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithPrivates2.ts, 11, 25), Decl(objectTypesIdentityWithPrivates2.ts, 13, 28), Decl(objectTypesIdentityWithPrivates2.ts, 14, 28))
>x : Symbol(x, Decl(objectTypesIdentityWithPrivates2.ts, 15, 14))
function foo3(x: C<string>);
>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithPrivates2.ts, 15, 25), Decl(objectTypesIdentityWithPrivates2.ts, 17, 28), Decl(objectTypesIdentityWithPrivates2.ts, 18, 28))
>x : Symbol(x, Decl(objectTypesIdentityWithPrivates2.ts, 17, 14))
>C : Symbol(C, Decl(objectTypesIdentityWithPrivates2.ts, 0, 0))
function foo3(x: D<number>); // ok
>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithPrivates2.ts, 15, 25), Decl(objectTypesIdentityWithPrivates2.ts, 17, 28), Decl(objectTypesIdentityWithPrivates2.ts, 18, 28))
>x : Symbol(x, Decl(objectTypesIdentityWithPrivates2.ts, 18, 14))
>D : Symbol(D, Decl(objectTypesIdentityWithPrivates2.ts, 4, 1))
function foo3(x: any) { }
>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithPrivates2.ts, 15, 25), Decl(objectTypesIdentityWithPrivates2.ts, 17, 28), Decl(objectTypesIdentityWithPrivates2.ts, 18, 28))
>x : Symbol(x, Decl(objectTypesIdentityWithPrivates2.ts, 19, 14))
function foo4(x: C<number>): number;
>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithPrivates2.ts, 19, 25), Decl(objectTypesIdentityWithPrivates2.ts, 21, 36), Decl(objectTypesIdentityWithPrivates2.ts, 22, 36))
>x : Symbol(x, Decl(objectTypesIdentityWithPrivates2.ts, 21, 14))
>C : Symbol(C, Decl(objectTypesIdentityWithPrivates2.ts, 0, 0))
function foo4(x: D<number>): string; // BUG 831926
>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithPrivates2.ts, 19, 25), Decl(objectTypesIdentityWithPrivates2.ts, 21, 36), Decl(objectTypesIdentityWithPrivates2.ts, 22, 36))
>x : Symbol(x, Decl(objectTypesIdentityWithPrivates2.ts, 22, 14))
>D : Symbol(D, Decl(objectTypesIdentityWithPrivates2.ts, 4, 1))
function foo4(x: any): any { }
>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithPrivates2.ts, 19, 25), Decl(objectTypesIdentityWithPrivates2.ts, 21, 36), Decl(objectTypesIdentityWithPrivates2.ts, 22, 36))
>x : Symbol(x, Decl(objectTypesIdentityWithPrivates2.ts, 23, 14))
var r = foo4(new C<number>());
>r : Symbol(r, Decl(objectTypesIdentityWithPrivates2.ts, 25, 3), Decl(objectTypesIdentityWithPrivates2.ts, 26, 3))
>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithPrivates2.ts, 19, 25), Decl(objectTypesIdentityWithPrivates2.ts, 21, 36), Decl(objectTypesIdentityWithPrivates2.ts, 22, 36))
>C : Symbol(C, Decl(objectTypesIdentityWithPrivates2.ts, 0, 0))
var r = foo4(new D<number>());
>r : Symbol(r, Decl(objectTypesIdentityWithPrivates2.ts, 25, 3), Decl(objectTypesIdentityWithPrivates2.ts, 26, 3))
>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithPrivates2.ts, 19, 25), Decl(objectTypesIdentityWithPrivates2.ts, 21, 36), Decl(objectTypesIdentityWithPrivates2.ts, 22, 36))
>D : Symbol(D, Decl(objectTypesIdentityWithPrivates2.ts, 4, 1))
function foo5(x: C<number>): number;
>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithPrivates2.ts, 26, 30), Decl(objectTypesIdentityWithPrivates2.ts, 28, 36), Decl(objectTypesIdentityWithPrivates2.ts, 29, 36))
>x : Symbol(x, Decl(objectTypesIdentityWithPrivates2.ts, 28, 14))
>C : Symbol(C, Decl(objectTypesIdentityWithPrivates2.ts, 0, 0))
function foo5(x: C<number>): string; // error
>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithPrivates2.ts, 26, 30), Decl(objectTypesIdentityWithPrivates2.ts, 28, 36), Decl(objectTypesIdentityWithPrivates2.ts, 29, 36))
>x : Symbol(x, Decl(objectTypesIdentityWithPrivates2.ts, 29, 14))
>C : Symbol(C, Decl(objectTypesIdentityWithPrivates2.ts, 0, 0))
function foo5(x: any): any { }
>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithPrivates2.ts, 26, 30), Decl(objectTypesIdentityWithPrivates2.ts, 28, 36), Decl(objectTypesIdentityWithPrivates2.ts, 29, 36))
>x : Symbol(x, Decl(objectTypesIdentityWithPrivates2.ts, 30, 14))
function foo6(x: D<number>): number;
>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithPrivates2.ts, 30, 30), Decl(objectTypesIdentityWithPrivates2.ts, 32, 36), Decl(objectTypesIdentityWithPrivates2.ts, 33, 36))
>x : Symbol(x, Decl(objectTypesIdentityWithPrivates2.ts, 32, 14))
>D : Symbol(D, Decl(objectTypesIdentityWithPrivates2.ts, 4, 1))
function foo6(x: D<number>): string; // error
>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithPrivates2.ts, 30, 30), Decl(objectTypesIdentityWithPrivates2.ts, 32, 36), Decl(objectTypesIdentityWithPrivates2.ts, 33, 36))
>x : Symbol(x, Decl(objectTypesIdentityWithPrivates2.ts, 33, 14))
>D : Symbol(D, Decl(objectTypesIdentityWithPrivates2.ts, 4, 1))
function foo6(x: any): any { }
>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithPrivates2.ts, 30, 30), Decl(objectTypesIdentityWithPrivates2.ts, 32, 36), Decl(objectTypesIdentityWithPrivates2.ts, 33, 36))
>x : Symbol(x, Decl(objectTypesIdentityWithPrivates2.ts, 34, 14))
|