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
typeM<MPextends{[k: string]: {}}>={[kinkeyofMP&string]: any// if & string is ommited then it compiles ok}functionF<Dextends{[k: string]: {}}>(_d: D): {new(): M<D>}{returnnullasany}classPextendsF({x: {}}){}
Expected behavior:
It should compile without crashing
Actual behavior:
TypeError: Cannot read property 'length' of undefined
at Object.find (../../node_modules/typescript/lib/typescript.js:509:35)
at checkKindsOfPropertyMemberOverrides (../../node_modules/typescript/lib/typescript.js:75911:52)
at checkClassLikeDeclaration (../../node_modules/typescript/lib/typescript.js:75736:21)
at checkClassDeclaration (../../node_modules/typescript/lib/typescript.js:75662:13)
at checkSourceElementWorker (../../node_modules/typescript/lib/typescript.js:77032:28)
at checkSourceElement (../../node_modules/typescript/lib/typescript.js:76873:17)
at Object.forEach (../../node_modules/typescript/lib/typescript.js:382:30)
at checkSourceFileWorker (../../node_modules/typescript/lib/typescript.js:77217:20)
at checkSourceFile (../../node_modules/typescript/lib/typescript.js:77184:13)
at getDiagnosticsWorker (../../node_modules/typescript/lib/typescript.js:77273:17)
TypeScript Version: 4.1.2
Search Terms: key union, useDefineForClassFields
Code
Given useDefineForClassFields is set to true
Expected behavior:
It should compile without crashing
Actual behavior:
Playground Link:
See the crash in the browser console
https://www.typescriptlang.org/play?useDefineForClassFields=true#code/C4TwDgpgBAsgPDAClCAPYEB2ATAzlAbygG0BrALil2ACcBLTAcwF1KCBfKdgPigF5CAWABQUEqSgMopCCAD2AM1jIAZFVoMWlAIaYQUAPQHJStdXpNJ+OQFsbdDNijAAFlknAoAY1tg6AGwhrUhF2EREFAFdML2A6OUwoADE4ABEUdCw8QnFKc01WQk4eAAoRMQB9bEpUkQBKNnKoTAgAdygShtg07lChUSgaCGBImkTMSP9-KG18XRBQ8OEvf1n8ZDQMHHwkkqJUNmK6oqA
Related Issues:
The text was updated successfully, but these errors were encountered: