Skip to content

Array of tuple default initializer assignability issue #15696

Closed

Description

@tinganho

TypeScript Version: 2.2.1 / nightly (2.2.0-dev.201xxxxx)

Code

let a: [string, 'asc' | 'desc'][];
a = [['some', 'asc']]; // No error

class A {
    a: [string, 'asc' | 'desc'][];
}

class B extends A {
    a = [['some', 'asc']]; // Error string[][] is not assignable to [string, 'asc' | 'desc'][]
}

Expected behavior:
The default initialised member a in class B should not error.

Actual behavior:
The default initialised member a errors.

Activity

  1. RyanCavanaugh commented on May 9, 2017

    @RyanCavanaugh
    Member

    Duplicate #10570

  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