Skip to content

[swift2objc] Support async initializers and properties #1778

Closed
@liamappelbe

Description

@liamappelbe

Working on #1773, I found that async initializers and property getters can't be marked with @objc:

pkgs/swift2objc/test/integration/async_output.swift:36:9: error: 'async' initializer cannot be represented in Objective-C
  @objc init(y: Int) async {
        ^            ~~~~~

pkgs/swift2objc/test/integration/async_output.swift:26:20: error: property with 'throws' or 'async' is not representable in Objective-C
  @objc public var x: MyClassWrapper {
                   ^

Similarly to #1765, the fix is to transform these initializers and properties into a static method.

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

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions