Skip to content

Tuple unpacking should also be applicable for nested tuples #19311

Open
@asarkar

Description

@asarkar

Compiler version

3.3.1

Minimized example

def f(x: (Int, Int)) = x(0) + x(1)
List((1, 2), (3, 4)).map(f) // ok
List((1, (2, 3)), (3, (4, 5))).map((a, (b, c)) => a + f(b, c)) // not ok

Output

) expected but => found
not a legal formal parameter for a function literal
Not found: b
Not found: c

Expectation

Tuple unpacking should also be applicable for nested tuples.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions