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
When we add types on properties base class, if a child class extends this base class, we will lost types and get corrupted behavior.
Actually is seem affected by keyof T, i not tested all others types, but this one make coruptions.
From what i understand, the child class seem ignore the type from parent !
Or maybe i miss understand the logic here ? if you have alternative to suggest ?
sample js:
constTypesEnum={abc: 'abc',abcd: 'abcd',abcde: 'abcde',};exportclassBase{/**@type {keyof TypesEnum} - all work fine here, default null for the example purpose */_test=null;constructor(data){}}exportclassAextendsBase{/** type are corrupted with vscode Intelisence , we should see and allowed to use the result of keyof TypesEnum ! */_test='abc';//lint a error and we lost intellisense in Vscode (ctrl+space)!constructor(data){super();}}
🙁 Actual behavior
we lost intellisence in Vscode ! and type become corupted.
🙂 Expected behavior
type keyof should be heritate in the child class !
Without write again /**@type {keyof TypesEnum} */ in the child class !
tsc versions: 4.1.3 and 4.2.0-dev.20210128
Version : 1.52.1 (user setup)
Commit : ea3859d4ba2f3e577a159bc91e3074c5d85c0523
Date : 2020-12-16T16:34:46.910Z
Electron : 9.3.5
Chrome : 83.0.4103.122
Node.js : 12.14.1
V8 : 8.3.110.13-electron.0
OS : Windows_NT x64 10.0.19042
The text was updated successfully, but these errors were encountered:
When we add types on properties base class, if a child class extends this base class, we will lost types and get corrupted behavior.
Actually is seem affected by
keyof T
, i not tested all others types, but this one make coruptions.From what i understand, the child class seem ignore the type from parent !
Or maybe i miss understand the logic here ? if you have alternative to suggest ?
sample js:
🙁 Actual behavior
we lost intellisence in Vscode ! and type become corupted.
🙂 Expected behavior
type keyof should be heritate in the child class !

Without write again /**@type {keyof TypesEnum} */ in the child class !
tsc versions:
4.1.3
and4.2.0-dev.20210128
Version : 1.52.1 (user setup)
Commit : ea3859d4ba2f3e577a159bc91e3074c5d85c0523
Date : 2020-12-16T16:34:46.910Z
Electron : 9.3.5
Chrome : 83.0.4103.122
Node.js : 12.14.1
V8 : 8.3.110.13-electron.0
OS : Windows_NT x64 10.0.19042
The text was updated successfully, but these errors were encountered: