undefined not assignable error within "if" statement, when member of Readonly<T> #28997
Labels
Bug
A bug in TypeScript
Domain: Control Flow
The issue relates to control flow analysis
Domain: Mapped Types
The issue relates to mapped types
Milestone
TypeScript Version: 3.3.0-dev.20181212
readonly if
Code
Expected behavior:
I expect the above to compile without error
Actual behavior:
There's an error - Type 'undefined' is not assignable to type 'string'
"foo1" above can't be undefined because it's within an "if (foo1) {}".
Playground
link
The text was updated successfully, but these errors were encountered: