Here is a demo:
class Vec2 {};
class Vec3 {};
class Vec4 {};
let mylibs = {
Vec2: Vec2,
Vec3: Vec3,
Vec4: Vec4
};
let len = Math.round(Math.random() * 2) + 2;
let VecType = 'Vec' + len;
let randomVector = new mylibs[VecType]();
I want to create something by user input, the VecType is something I used to simulate user input.
The code above works, and tsc will not throw any error. However in my vscode, it tell me something wrong.
I want to resolve this kind of error. Thanks.

