TypeScript/tests/cases/conformance/controlFlow/controlFlowStringIndex.ts

12 lines
270 B
TypeScript
Raw Normal View History

// @strict: true
2017-11-08 19:56:30 +01:00
type A = {
other: number | null;
[index: string]: number | null
};
declare const value: A;
if (value.foo !== null) {
value.foo.toExponential()
2017-11-08 19:56:30 +01:00
value.other // should still be number | null
value.bar // should still be number | null
}