declare class C {
    static x: number;
    static foo(x: number): void;

    constructor(x: string): void;
}

C.x = "";
C.foo("");

C.name as string;
C.name as number; // error, it's a string

declare class D extends C { }
new D(123); // error, number ~> string

declare class E {
    readonly [key: string]: number;
}
;new E()['a'] as number // no error
