mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
41 lines
1.6 KiB
Plaintext
41 lines
1.6 KiB
Plaintext
//// [tests/cases/conformance/controlFlow/controlFlowStringIndex.ts] ////
|
|
|
|
=== controlFlowStringIndex.ts ===
|
|
type A = {
|
|
>A : Symbol(A, Decl(controlFlowStringIndex.ts, 0, 0))
|
|
|
|
other: number | null;
|
|
>other : Symbol(other, Decl(controlFlowStringIndex.ts, 0, 10))
|
|
|
|
[index: string]: number | null
|
|
>index : Symbol(index, Decl(controlFlowStringIndex.ts, 2, 5))
|
|
|
|
};
|
|
declare const value: A;
|
|
>value : Symbol(value, Decl(controlFlowStringIndex.ts, 4, 13))
|
|
>A : Symbol(A, Decl(controlFlowStringIndex.ts, 0, 0))
|
|
|
|
if (value.foo !== null) {
|
|
>value.foo : Symbol(__index, Decl(controlFlowStringIndex.ts, 1, 25))
|
|
>value : Symbol(value, Decl(controlFlowStringIndex.ts, 4, 13))
|
|
>foo : Symbol(__index, Decl(controlFlowStringIndex.ts, 1, 25))
|
|
|
|
value.foo.toExponential()
|
|
>value.foo.toExponential : Symbol(Number.toExponential, Decl(lib.es5.d.ts, --, --))
|
|
>value.foo : Symbol(__index, Decl(controlFlowStringIndex.ts, 1, 25))
|
|
>value : Symbol(value, Decl(controlFlowStringIndex.ts, 4, 13))
|
|
>foo : Symbol(__index, Decl(controlFlowStringIndex.ts, 1, 25))
|
|
>toExponential : Symbol(Number.toExponential, Decl(lib.es5.d.ts, --, --))
|
|
|
|
value.other // should still be number | null
|
|
>value.other : Symbol(other, Decl(controlFlowStringIndex.ts, 0, 10))
|
|
>value : Symbol(value, Decl(controlFlowStringIndex.ts, 4, 13))
|
|
>other : Symbol(other, Decl(controlFlowStringIndex.ts, 0, 10))
|
|
|
|
value.bar // should still be number | null
|
|
>value.bar : Symbol(__index, Decl(controlFlowStringIndex.ts, 1, 25))
|
|
>value : Symbol(value, Decl(controlFlowStringIndex.ts, 4, 13))
|
|
>bar : Symbol(__index, Decl(controlFlowStringIndex.ts, 1, 25))
|
|
}
|
|
|