Skip to content

Tuples constructed via array literals don't typecheck against tuple constraints #3369

Closed
@ccapndave

Description

@ccapndave
type Point = [number, number]; var x = [1, 2]; var p: Point = x;

In this case p won't typecheck because x has been inferred as number[] instead of [number, number]. It would be really nice if the type system could check against both types.

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