Skip to content
This repository was archived by the owner on Jun 15, 2023. It is now read-only.
This repository was archived by the owner on Jun 15, 2023. It is now read-only.

Feature: relax the constraint of ... in list construction #670

Closed
@bobzhang

Description

@bobzhang

Currently, ... is only allowed in the tail position, list {1,2,... tail},
For example:

let l = a => list{1,2,...a} // works
let l = a => list{1,2,...a, 3,  ...a} // fails

The current situation is a bit weird, it is not a syntax error, but a type error

This has type: int Somewhere wanted: list<int>

This also seems to be a bug:

let l = (a,b) => list{1,2, ...b , 3,...a}

The inferred type for b is int

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions