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
'use strict';classUser{firstName: string;lastName: string;staticgetInstance(){returnnewthis();}}classStaffUserextendsUser{position: string;}letstaffUser=StaffUser.getInstance();console.log(staffUser.position);// error TS2339: Property 'position' does not exist on type 'User'
Expected behavior:
staffUser should be of type StaffUser, not simply User.
Actual behavior:
The compiler doesn't guess that getInstance in StaffUser returns instances of StaffUser.
The text was updated successfully, but these errors were encountered:
TypeScript Version:
1.8.7
Code
Expected behavior:
staffUser
should be of typeStaffUser
, not simplyUser
.Actual behavior:
The compiler doesn't guess that
getInstance
inStaffUser
returns instances ofStaffUser
.The text was updated successfully, but these errors were encountered: