Skip to content

Checker: numeric enum reverse reads ignore noUncheckedIndexedAccess #3557

Closed

Description

@nickna
enum E { A = 1 }
const wrong: string = E[1];

With --no-tsconfig --strict --noEmit --noUncheckedIndexedAccess case.ts, the SharpTS CLI rebuilt from main at a3683d903 exits successfully. TypeScript 6.0.3 reports TS2322 for string | undefined under --ignoreConfig --strict --noEmit --noUncheckedIndexedAccess case.ts. This happens even for a known numeric reverse key.

PR #3552 covers canonical numeric string keys in #3530. This report covers the existing number index path under the checker option. #3551 covers a missing numeric key throwing at runtime, independently of checker options.

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