Skip to content

[T] tuple type information is lost as T[] #8276

Description

TypeScript Version:

nightly (1.9.0-dev.20160213)

Code

interfaceGeo{latlng: [number,number]// tuple}functionworld(geo: Geo){}world({latlng: [35,-112]});// works fineletcoordinates={latlng: [35,-112]};world(coordinates);// errorsletcoordinatesTyped: Geo={latlng: [35,-112]};world(coordinatesTyped);// works fine

Expected behavior:

Compile without errors.

Actual behavior:

Error, [T] tuple type information is lost as T[]:

Type 'number[]' is not assignable to type '[number, number]'.

Metadata

Metadata

Assignees

No one assigned

    Labels

    By DesignDeprecated - use "Working as Intended" or "Design Limitation" instead

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions