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
typeRect={width: number|undefined;}classHasARect<TextendsRect>{rect: T;get<KextendskeyofT>(prop: K): T[K]{returnthis.rect[prop];}getWidth(r: T): number{returnthis.get("width")||0;// Type 'undefined' is not assignable to type 'number'.}}
Expected behavior:
This is not a type error.
Actual behavior:
Type 'T["width"]' is not assignable to type 'number'.
Type 'number | undefined' is not assignable to type 'number'.
Type 'undefined' is not assignable to type 'number'.