Closed
Description
TypeScript Version: 2.5.3) / 2.6.0-dev.20170930
Code
https://github.com/dryganets/typescript-bug/blob/master/index.ts
I expect this code to compile.
This example is
Expected behavior:
type guard
if (this.props.a) {
}
reduces the type from string|undefined to string.
Actual behavior:
type is still string|undefined after check.
The bug doesn't repro if I use the slightly different syntax:
export class Test extends ComponentBase<Props, {}> {
But we have some places in the app where the former syntax is required.