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
classConnection{publicquery(sql){returnnull;}}classDatabase{privatereadonlyproperty: string='This is initialized';privatereadonlythisToo: number;privatereadonlyconnection: Connection;constructor(){this.thisToo=42;}publicimportantMethod(){returnthis.connection.query('SELECT * FROM users');}}
Expected behavior:
I expect the property connection to be reported as "Not initialized read-only property" error because it is
not initialized in constructor
also marked as readonly so it can't be initialized anywhere else.
Actual behavior:
Compiler generates broken / not working code.
varDatabase=/** @class */(function(){functionDatabase(){this.property='This is initialized';this.thisToo=42;}Database.prototype.importantMethod=function(){returnthis.connection.query('SELECT * FROM users');};returnDatabase;}());
The text was updated successfully, but these errors were encountered:
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.2
Code
Expected behavior:
I expect the property
connection
to be reported as "Not initialized read-only property" error because it isreadonly
so it can't be initialized anywhere else.Actual behavior:
Compiler generates broken / not working code.
The text was updated successfully, but these errors were encountered: