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
interfaceUser{name: string|null}functionbaz(u: User){constisValid=u.name!==nullif(isValid){// `u.name` should be `string`, but the following error appears:// User.name: string | null// Object is possibly 'null'. (2531)u.name.length}}
π Actual behavior
u.name is of type string | null
π Expected behavior
u.name should be of type string
The text was updated successfully, but these errors were encountered:
Bug Report
π Search Terms
Control Flow Analysis
type guard
π Version & Regression Information
β― Playground Link
Playground link with relevant code
π» Code
π Actual behavior
u.name
is of typestring | null
π Expected behavior
u.name
should be of typestring
The text was updated successfully, but these errors were encountered: