Skip to content

Incorrect ambiguity report #1371

Description

@Thrameos

In resolving foo(Bar, Bar) vs foo(Bar...) an ambiguous method overload is being reported. Apparently, this antipattern is properly handled in Java. The fix is to check for an ambiguity in org.jpype.typemanager.MethodResolution.java and add the varargs on to the veto list. Easy fix for anyone who has time.

jsboige/CoursIA#1325

Note the comment did not consider the 5th special case:

  // Special handling is needed for varargs as it may chop or expand.
    // we have 4 cases for a varargs methods
    //    foo(Arg0, Arg1...) as
    //       foo(Arg0)
    //       foo(Arg0, Arg1)
    //       foo(Arg0, Arg1[])
    //       foo(Arg0, Arg1, Arg1+)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions