Skip to content

Implement use_type: "tuple" #24

Open

Description

@evestera

Currently tuples are only used when all source arrays have the same length and combining the shapes of the array would lose type information. E.g. you can end up with [["a", 1], ["b", 2]] is inferred to Array<[string, number]>, but [[1, 2], [3, 4]] is inferred as number[][].

We already have the hint use_type: "map". We should similarly have use_type: "tuple" and with that make it possible to end up with types like [string, string] and [number, number, number?].

Activity

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions