Given the following code:
class A {}
const x = {
constructor: A
}
const readonlyX: ReadonlyDeep<typeof x> = x;
const y = new readonlyX.constructor();
The last line gives the following error:
This expression is not constructable. Type 'ReadonlyObjectDeep<typeof A>' has no construct signatures.ts(2351)
This should probably be legitimate because using the constructor doesn't change the variable itself.
Given the following code:
The last line gives the following error:
This expression is not constructable. Type 'ReadonlyObjectDeep<typeof A>' has no construct signatures.ts(2351)This should probably be legitimate because using the constructor doesn't change the variable itself.