You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
dryganets
changed the title
Typescript incorrectly infer the types for Readonly members.
Typescript incorrectly infer the types for Readonly optional properties.
Oct 3, 2017
This is a duplicate of #15376. this.prop.a is a generic type, P["a"], and there is no way currently to narrow a generic type.
It is worth noting that the compiler does the right thing on property access/ index access/ call thanks to #15576. but the type of the symbol does not change.
Automatically closing this issue for housekeeping purposes. The issue labels indicate that it is unactionable at the moment or has already been addressed.
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
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:
But we have some places in the app where the former syntax is required.
The text was updated successfully, but these errors were encountered: