|
| 1 | +=== tests/cases/compiler/intersectionWithConflictingPrivates.ts === |
| 2 | +class A { private x: unknown; y?: string; } |
| 3 | +>A : Symbol(A, Decl(intersectionWithConflictingPrivates.ts, 0, 0)) |
| 4 | +>x : Symbol(A.x, Decl(intersectionWithConflictingPrivates.ts, 0, 9)) |
| 5 | +>y : Symbol(A.y, Decl(intersectionWithConflictingPrivates.ts, 0, 29)) |
| 6 | + |
| 7 | +class B { private x: unknown; y?: string; } |
| 8 | +>B : Symbol(B, Decl(intersectionWithConflictingPrivates.ts, 0, 43)) |
| 9 | +>x : Symbol(B.x, Decl(intersectionWithConflictingPrivates.ts, 1, 9)) |
| 10 | +>y : Symbol(B.y, Decl(intersectionWithConflictingPrivates.ts, 1, 29)) |
| 11 | + |
| 12 | +declare let ab: A & B; |
| 13 | +>ab : Symbol(ab, Decl(intersectionWithConflictingPrivates.ts, 3, 11)) |
| 14 | +>A : Symbol(A, Decl(intersectionWithConflictingPrivates.ts, 0, 0)) |
| 15 | +>B : Symbol(B, Decl(intersectionWithConflictingPrivates.ts, 0, 43)) |
| 16 | + |
| 17 | +ab.y = 'hello'; |
| 18 | +>ab : Symbol(ab, Decl(intersectionWithConflictingPrivates.ts, 3, 11)) |
| 19 | + |
| 20 | +ab = {}; |
| 21 | +>ab : Symbol(ab, Decl(intersectionWithConflictingPrivates.ts, 3, 11)) |
| 22 | + |
| 23 | +function f1(node: A | B) { |
| 24 | +>f1 : Symbol(f1, Decl(intersectionWithConflictingPrivates.ts, 5, 8)) |
| 25 | +>node : Symbol(node, Decl(intersectionWithConflictingPrivates.ts, 7, 12)) |
| 26 | +>A : Symbol(A, Decl(intersectionWithConflictingPrivates.ts, 0, 0)) |
| 27 | +>B : Symbol(B, Decl(intersectionWithConflictingPrivates.ts, 0, 43)) |
| 28 | + |
| 29 | + if (node instanceof A || node instanceof A) { |
| 30 | +>node : Symbol(node, Decl(intersectionWithConflictingPrivates.ts, 7, 12)) |
| 31 | +>A : Symbol(A, Decl(intersectionWithConflictingPrivates.ts, 0, 0)) |
| 32 | +>node : Symbol(node, Decl(intersectionWithConflictingPrivates.ts, 7, 12)) |
| 33 | +>A : Symbol(A, Decl(intersectionWithConflictingPrivates.ts, 0, 0)) |
| 34 | + |
| 35 | + node; // A |
| 36 | +>node : Symbol(node, Decl(intersectionWithConflictingPrivates.ts, 7, 12)) |
| 37 | + } |
| 38 | + else { |
| 39 | + node; // B |
| 40 | +>node : Symbol(node, Decl(intersectionWithConflictingPrivates.ts, 7, 12)) |
| 41 | + } |
| 42 | + node; // A | B |
| 43 | +>node : Symbol(node, Decl(intersectionWithConflictingPrivates.ts, 7, 12)) |
| 44 | +} |
| 45 | + |
| 46 | +// Repro from #37659 |
| 47 | + |
| 48 | +abstract class ViewNode { } |
| 49 | +>ViewNode : Symbol(ViewNode, Decl(intersectionWithConflictingPrivates.ts, 15, 1)) |
| 50 | + |
| 51 | +abstract class ViewRefNode extends ViewNode { } |
| 52 | +>ViewRefNode : Symbol(ViewRefNode, Decl(intersectionWithConflictingPrivates.ts, 19, 27)) |
| 53 | +>ViewNode : Symbol(ViewNode, Decl(intersectionWithConflictingPrivates.ts, 15, 1)) |
| 54 | + |
| 55 | +abstract class ViewRefFileNode extends ViewRefNode { } |
| 56 | +>ViewRefFileNode : Symbol(ViewRefFileNode, Decl(intersectionWithConflictingPrivates.ts, 20, 47)) |
| 57 | +>ViewRefNode : Symbol(ViewRefNode, Decl(intersectionWithConflictingPrivates.ts, 19, 27)) |
| 58 | + |
| 59 | +class CommitFileNode extends ViewRefFileNode { |
| 60 | +>CommitFileNode : Symbol(CommitFileNode, Decl(intersectionWithConflictingPrivates.ts, 21, 54)) |
| 61 | +>ViewRefFileNode : Symbol(ViewRefFileNode, Decl(intersectionWithConflictingPrivates.ts, 20, 47)) |
| 62 | + |
| 63 | + private _id: any; |
| 64 | +>_id : Symbol(CommitFileNode._id, Decl(intersectionWithConflictingPrivates.ts, 23, 46)) |
| 65 | +} |
| 66 | + |
| 67 | +class ResultsFileNode extends ViewRefFileNode { |
| 68 | +>ResultsFileNode : Symbol(ResultsFileNode, Decl(intersectionWithConflictingPrivates.ts, 25, 1)) |
| 69 | +>ViewRefFileNode : Symbol(ViewRefFileNode, Decl(intersectionWithConflictingPrivates.ts, 20, 47)) |
| 70 | + |
| 71 | + private _id: any; |
| 72 | +>_id : Symbol(ResultsFileNode._id, Decl(intersectionWithConflictingPrivates.ts, 27, 47)) |
| 73 | +} |
| 74 | + |
| 75 | +class StashFileNode extends CommitFileNode { |
| 76 | +>StashFileNode : Symbol(StashFileNode, Decl(intersectionWithConflictingPrivates.ts, 29, 1)) |
| 77 | +>CommitFileNode : Symbol(CommitFileNode, Decl(intersectionWithConflictingPrivates.ts, 21, 54)) |
| 78 | + |
| 79 | + private _id2: any; |
| 80 | +>_id2 : Symbol(StashFileNode._id2, Decl(intersectionWithConflictingPrivates.ts, 31, 44)) |
| 81 | +} |
| 82 | + |
| 83 | +class StatusFileNode extends ViewNode { |
| 84 | +>StatusFileNode : Symbol(StatusFileNode, Decl(intersectionWithConflictingPrivates.ts, 33, 1)) |
| 85 | +>ViewNode : Symbol(ViewNode, Decl(intersectionWithConflictingPrivates.ts, 15, 1)) |
| 86 | + |
| 87 | + private _id: any; |
| 88 | +>_id : Symbol(StatusFileNode._id, Decl(intersectionWithConflictingPrivates.ts, 35, 39)) |
| 89 | +} |
| 90 | + |
| 91 | +class Foo { |
| 92 | +>Foo : Symbol(Foo, Decl(intersectionWithConflictingPrivates.ts, 37, 1)) |
| 93 | + |
| 94 | + private async foo(node: CommitFileNode | ResultsFileNode | StashFileNode) { |
| 95 | +>foo : Symbol(Foo.foo, Decl(intersectionWithConflictingPrivates.ts, 39, 11)) |
| 96 | +>node : Symbol(node, Decl(intersectionWithConflictingPrivates.ts, 40, 20)) |
| 97 | +>CommitFileNode : Symbol(CommitFileNode, Decl(intersectionWithConflictingPrivates.ts, 21, 54)) |
| 98 | +>ResultsFileNode : Symbol(ResultsFileNode, Decl(intersectionWithConflictingPrivates.ts, 25, 1)) |
| 99 | +>StashFileNode : Symbol(StashFileNode, Decl(intersectionWithConflictingPrivates.ts, 29, 1)) |
| 100 | + |
| 101 | + if ( |
| 102 | + !(node instanceof CommitFileNode) && |
| 103 | +>node : Symbol(node, Decl(intersectionWithConflictingPrivates.ts, 40, 20)) |
| 104 | +>CommitFileNode : Symbol(CommitFileNode, Decl(intersectionWithConflictingPrivates.ts, 21, 54)) |
| 105 | + |
| 106 | + !(node instanceof StashFileNode) && |
| 107 | +>node : Symbol(node, Decl(intersectionWithConflictingPrivates.ts, 40, 20)) |
| 108 | +>StashFileNode : Symbol(StashFileNode, Decl(intersectionWithConflictingPrivates.ts, 29, 1)) |
| 109 | + |
| 110 | + !(node instanceof ResultsFileNode) |
| 111 | +>node : Symbol(node, Decl(intersectionWithConflictingPrivates.ts, 40, 20)) |
| 112 | +>ResultsFileNode : Symbol(ResultsFileNode, Decl(intersectionWithConflictingPrivates.ts, 25, 1)) |
| 113 | + |
| 114 | + ) { |
| 115 | + return; |
| 116 | + } |
| 117 | + |
| 118 | + await this.bar(node); |
| 119 | +>this.bar : Symbol(Foo.bar, Decl(intersectionWithConflictingPrivates.ts, 50, 2)) |
| 120 | +>this : Symbol(Foo, Decl(intersectionWithConflictingPrivates.ts, 37, 1)) |
| 121 | +>bar : Symbol(Foo.bar, Decl(intersectionWithConflictingPrivates.ts, 50, 2)) |
| 122 | +>node : Symbol(node, Decl(intersectionWithConflictingPrivates.ts, 40, 20)) |
| 123 | + } |
| 124 | + |
| 125 | + private async bar(node: CommitFileNode | ResultsFileNode | StashFileNode | StatusFileNode, options?: {}) { |
| 126 | +>bar : Symbol(Foo.bar, Decl(intersectionWithConflictingPrivates.ts, 50, 2)) |
| 127 | +>node : Symbol(node, Decl(intersectionWithConflictingPrivates.ts, 52, 20)) |
| 128 | +>CommitFileNode : Symbol(CommitFileNode, Decl(intersectionWithConflictingPrivates.ts, 21, 54)) |
| 129 | +>ResultsFileNode : Symbol(ResultsFileNode, Decl(intersectionWithConflictingPrivates.ts, 25, 1)) |
| 130 | +>StashFileNode : Symbol(StashFileNode, Decl(intersectionWithConflictingPrivates.ts, 29, 1)) |
| 131 | +>StatusFileNode : Symbol(StatusFileNode, Decl(intersectionWithConflictingPrivates.ts, 33, 1)) |
| 132 | +>options : Symbol(options, Decl(intersectionWithConflictingPrivates.ts, 52, 92)) |
| 133 | + |
| 134 | + return Promise.resolve(undefined); |
| 135 | +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) |
| 136 | +>Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2018.promise.d.ts, --, --)) |
| 137 | +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) |
| 138 | +>undefined : Symbol(undefined) |
| 139 | + } |
| 140 | +} |
| 141 | + |
0 commit comments