Skip to content

type check issue #16986

Description

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 }'.

Activity

  1. RyanCavanaugh commented on Jul 7, 2017

    @RyanCavanaugh
    Member

    See #16047 for details on this change

  2. locked and limited conversation to collaborators on Jun 14, 2018
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

    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