Skip to content

[swift2objc] Support tuples #1783

@liamappelbe

Description

@liamappelbe

Like Dart records, Swift tuples can have positional and named elements. The main difference is that to access the first element of a Dart record you write foo.$1, whereas in Swift you write foo.0.

Tuples are easy enough to parse, but they're not supported in @objc annotated APIs. So we'll need to transform them into classes.

(Int, String, abc: MyClass)

// Would be transformed to something like:

public class Tuple_Int_String_abc_MyClass {
    public let _0: Int
    public let _1: String
    public let abc: MyClassWrapper
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueA good starting issue for contributors (issues with this label will appear in /contribute)package:swift2objc

    Type

    No type

    Projects

    Status

    No status

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions