|
| 1 | +=== tests/cases/compiler/privatePropertyInUnion.ts === |
| 2 | +// Repro from #38236 |
| 3 | + |
| 4 | +type Type = string | object; |
| 5 | +>Type : Symbol(Type, Decl(privatePropertyInUnion.ts, 0, 0)) |
| 6 | + |
| 7 | +class SyncableObject { |
| 8 | +>SyncableObject : Symbol(SyncableObject, Decl(privatePropertyInUnion.ts, 2, 28)) |
| 9 | + |
| 10 | + private foo: unknown; |
| 11 | +>foo : Symbol(SyncableObject.foo, Decl(privatePropertyInUnion.ts, 4, 22)) |
| 12 | +} |
| 13 | + |
| 14 | +interface SyncableRef<T extends ISyncableObject> {} |
| 15 | +>SyncableRef : Symbol(SyncableRef, Decl(privatePropertyInUnion.ts, 6, 1)) |
| 16 | +>T : Symbol(T, Decl(privatePropertyInUnion.ts, 8, 22)) |
| 17 | +>ISyncableObject : Symbol(ISyncableObject, Decl(privatePropertyInUnion.ts, 8, 51)) |
| 18 | + |
| 19 | +interface ISyncableObject<T = object> extends SyncableObject {} |
| 20 | +>ISyncableObject : Symbol(ISyncableObject, Decl(privatePropertyInUnion.ts, 8, 51)) |
| 21 | +>T : Symbol(T, Decl(privatePropertyInUnion.ts, 10, 26)) |
| 22 | +>SyncableObject : Symbol(SyncableObject, Decl(privatePropertyInUnion.ts, 2, 28)) |
| 23 | + |
| 24 | +type __ValueDescriptorType<T extends string | object> = T extends ISyncableObject ? SyncableRef<T> : T; |
| 25 | +>__ValueDescriptorType : Symbol(__ValueDescriptorType, Decl(privatePropertyInUnion.ts, 10, 63)) |
| 26 | +>T : Symbol(T, Decl(privatePropertyInUnion.ts, 12, 27)) |
| 27 | +>T : Symbol(T, Decl(privatePropertyInUnion.ts, 12, 27)) |
| 28 | +>ISyncableObject : Symbol(ISyncableObject, Decl(privatePropertyInUnion.ts, 8, 51)) |
| 29 | +>SyncableRef : Symbol(SyncableRef, Decl(privatePropertyInUnion.ts, 6, 1)) |
| 30 | +>T : Symbol(T, Decl(privatePropertyInUnion.ts, 12, 27)) |
| 31 | +>T : Symbol(T, Decl(privatePropertyInUnion.ts, 12, 27)) |
| 32 | + |
0 commit comments