Skip to content

[jextract] Handle ambiguous Swift methods not possible in Java #425

@madsodgaard

Description

@madsodgaard

If you try to wrap these functions

public init(throwing: Bool) throws {
  // ...  
}

public init?(doInit: Bool) {
  // ...
}

the current resulting Java functions would be:

public static MySwiftClass init(boolean throwing, SwiftArena swiftArena$) throws Exception
public static Optional<MySwiftClass> init(boolean doInit, SwiftArena swiftArena$)

which is not allowed in Java, since 'init(boolean, SwiftArena) is defined twice.

We should handle this, maybe adding the first parameterName as a suffix, or something else.

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