Skip to content

type check issue #16986

Closed
Closed
@pankleks

Description

@pankleks

I know it's a tricky construction in begin with - but it was compiling fine before 2.4.

class Foo {
  [id: string]: { a?: number, b?: number };
  v1?: string;
}

with TSC 2.4.1, it gives me an error:
TS2411: Property 'v1' of type 'string' is not assignable to string index type '{ a?: number, b?: number }'.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DuplicateAn existing issue was already created

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions