typescript: 4.7.0-dev.20220327
vscode: 1.66.0-insider

reproduce:
- install extension JavaScript and TypeScript Nightly
- toggle to latest typescript
- copy following code
- restart vscode
classTex{type='Text'asconst;}classSvg{type='Svg'asconst;}constmap={text: Tex,svg: Svg}typeM=typeofmap;exportfunctionbar<TextendskeyofM>(type: T): M[T]{consts=map[type];returns;}constcons=bar('text');consta=newcons();constt=s.type;
typescript: 4.7.0-dev.20220327
vscode: 1.66.0-insider
reproduce: