Skip to content

Swift overloads produce uncompilable wrappers #526

@abdulowork

Description

@abdulowork

Reproduction

It seems that overloads currently produce incorrect Java code. This is reproducible by creating:

public class OverloadSample {
    public func takeValue(a: String) {}
    public func takeValue(b: String) {}
}

in Samples/SwiftJavaExtractFFMSampleApp/Sources/MySwiftLibrary/OverloadSample.swift and running ./gradlew :Samples:SwiftJavaExtractFFMSampleApp:compileJava.

The compilation fails with:

OverloadSample.java:129: error: method takeValue(String) is already defined in class OverloadSample
    public void takeValue(java.lang.String b) {

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