|
| 1 | +=== tests/cases/compiler/typeGuardNarrowsIndexedAccessOfKnownProperty10.ts === |
| 2 | +interface Foo { bar: any; } |
| 3 | +>Foo : Symbol(Foo, Decl(typeGuardNarrowsIndexedAccessOfKnownProperty10.ts, 0, 0)) |
| 4 | +>bar : Symbol(Foo.bar, Decl(typeGuardNarrowsIndexedAccessOfKnownProperty10.ts, 0, 15)) |
| 5 | + |
| 6 | +const bar: { [id: string]: number } = {}; |
| 7 | +>bar : Symbol(bar, Decl(typeGuardNarrowsIndexedAccessOfKnownProperty10.ts, 1, 5)) |
| 8 | +>id : Symbol(id, Decl(typeGuardNarrowsIndexedAccessOfKnownProperty10.ts, 1, 14)) |
| 9 | + |
| 10 | +(foo: Foo) => { |
| 11 | +>foo : Symbol(foo, Decl(typeGuardNarrowsIndexedAccessOfKnownProperty10.ts, 3, 1)) |
| 12 | +>Foo : Symbol(Foo, Decl(typeGuardNarrowsIndexedAccessOfKnownProperty10.ts, 0, 0)) |
| 13 | + |
| 14 | + bar[id]++; |
| 15 | +>bar : Symbol(bar, Decl(typeGuardNarrowsIndexedAccessOfKnownProperty10.ts, 1, 5)) |
| 16 | +>id : Symbol(id, Decl(typeGuardNarrowsIndexedAccessOfKnownProperty10.ts, 5, 6)) |
| 17 | + |
| 18 | + const id = foo.bar; |
| 19 | +>id : Symbol(id, Decl(typeGuardNarrowsIndexedAccessOfKnownProperty10.ts, 5, 6)) |
| 20 | +>foo.bar : Symbol(Foo.bar, Decl(typeGuardNarrowsIndexedAccessOfKnownProperty10.ts, 0, 15)) |
| 21 | +>foo : Symbol(foo, Decl(typeGuardNarrowsIndexedAccessOfKnownProperty10.ts, 3, 1)) |
| 22 | +>bar : Symbol(Foo.bar, Decl(typeGuardNarrowsIndexedAccessOfKnownProperty10.ts, 0, 15)) |
| 23 | +} |
| 24 | + |
0 commit comments