Skip to content

Checker skips static block bodies in class expressions #3628

Closed

Description

@nickna
const C = class {
    static { const n: number = 'wrong'; }
};

SharpTS at 72455db66 accepts this with --no-tsconfig --strict --noEmit. TypeScript 6.0.3 reports TS2322 with --ignoreConfig --strict --target ES2022 --noEmit.

The checker should type-check the statements in a class expression's static block. Class declaration static block bodies already go through CheckClassStaticBlocks. Found while working on #3621.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions