|
| 1 | +//// [tests/cases/compiler/reverseMappedTypePrivateMembers.ts] //// |
| 2 | + |
| 3 | +=== reverseMappedTypePrivateMembers.ts === |
| 4 | +// https://github.com/microsoft/TypeScript/issues/64593 |
| 5 | + |
| 6 | +class Entity { |
| 7 | +>Entity : Symbol(Entity, Decl(reverseMappedTypePrivateMembers.ts, 0, 0)) |
| 8 | + |
| 9 | + private secret = 1; |
| 10 | +>secret : Symbol(Entity.secret, Decl(reverseMappedTypePrivateMembers.ts, 2, 14)) |
| 11 | + |
| 12 | + protected hidden = 2; |
| 13 | +>hidden : Symbol(Entity.hidden, Decl(reverseMappedTypePrivateMembers.ts, 3, 23)) |
| 14 | + |
| 15 | + markChanged(field: string): void {} |
| 16 | +>markChanged : Symbol(Entity.markChanged, Decl(reverseMappedTypePrivateMembers.ts, 4, 25)) |
| 17 | +>field : Symbol(field, Decl(reverseMappedTypePrivateMembers.ts, 5, 16)) |
| 18 | +} |
| 19 | +class Account extends Entity { |
| 20 | +>Account : Symbol(Account, Decl(reverseMappedTypePrivateMembers.ts, 6, 1)) |
| 21 | +>Entity : Symbol(Entity, Decl(reverseMappedTypePrivateMembers.ts, 0, 0)) |
| 22 | + |
| 23 | + emailAddress = ''; |
| 24 | +>emailAddress : Symbol(Account.emailAddress, Decl(reverseMappedTypePrivateMembers.ts, 7, 30)) |
| 25 | +} |
| 26 | + |
| 27 | +declare function getAccount<T extends object = object>(): Readonly<Account & T>; |
| 28 | +>getAccount : Symbol(getAccount, Decl(reverseMappedTypePrivateMembers.ts, 9, 1)) |
| 29 | +>T : Symbol(T, Decl(reverseMappedTypePrivateMembers.ts, 11, 28)) |
| 30 | +>Readonly : Symbol(Readonly, Decl(lib.es5.d.ts, --, --)) |
| 31 | +>Account : Symbol(Account, Decl(reverseMappedTypePrivateMembers.ts, 6, 1)) |
| 32 | +>T : Symbol(T, Decl(reverseMappedTypePrivateMembers.ts, 11, 28)) |
| 33 | + |
| 34 | +declare function getAccountPlain(): Readonly<Account & object>; |
| 35 | +>getAccountPlain : Symbol(getAccountPlain, Decl(reverseMappedTypePrivateMembers.ts, 11, 80)) |
| 36 | +>Readonly : Symbol(Readonly, Decl(lib.es5.d.ts, --, --)) |
| 37 | +>Account : Symbol(Account, Decl(reverseMappedTypePrivateMembers.ts, 6, 1)) |
| 38 | + |
| 39 | +export const plain = getAccountPlain() as Account; |
| 40 | +>plain : Symbol(plain, Decl(reverseMappedTypePrivateMembers.ts, 14, 12)) |
| 41 | +>getAccountPlain : Symbol(getAccountPlain, Decl(reverseMappedTypePrivateMembers.ts, 11, 80)) |
| 42 | +>Account : Symbol(Account, Decl(reverseMappedTypePrivateMembers.ts, 6, 1)) |
| 43 | + |
| 44 | +export const explicit = getAccount<object>() as Account; |
| 45 | +>explicit : Symbol(explicit, Decl(reverseMappedTypePrivateMembers.ts, 15, 12)) |
| 46 | +>getAccount : Symbol(getAccount, Decl(reverseMappedTypePrivateMembers.ts, 9, 1)) |
| 47 | +>Account : Symbol(Account, Decl(reverseMappedTypePrivateMembers.ts, 6, 1)) |
| 48 | + |
| 49 | +export const inferred = getAccount() as Account; |
| 50 | +>inferred : Symbol(inferred, Decl(reverseMappedTypePrivateMembers.ts, 16, 12)) |
| 51 | +>getAccount : Symbol(getAccount, Decl(reverseMappedTypePrivateMembers.ts, 9, 1)) |
| 52 | +>Account : Symbol(Account, Decl(reverseMappedTypePrivateMembers.ts, 6, 1)) |
| 53 | + |
0 commit comments