Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Java varargs not generated with separate compilation #10071

Closed
scabug opened this issue Nov 18, 2016 · 2 comments
Closed

Java varargs not generated with separate compilation #10071

scabug opened this issue Nov 18, 2016 · 2 comments
Assignees
Milestone

Comments

@scabug
Copy link

scabug commented Nov 18, 2016

varargs inherited annotated methods don't always generate a Java-style vararg method. For example:

// Props.scala
import foo.AbstractProps

class Props extends AbstractProps
// foo/AbstractProps.scala
package foo

import scala.annotation.varargs

trait AbstractProps {
  @varargs
  def create(x: Int, y: Int*): AbstractProps = null
}

When the two files are compiled together, class Props has a Java-style vararg method:

$ javap -classpath /tmp Props
Compiled from "Props_1.scala"
public class Props implements foo.AbstractProps {
  public foo.AbstractProps create(int, scala.collection.Seq<java.lang.Object>);
  public foo.AbstractProps create(int, int...);
  public Props();
}

When only Props.scala is compiled, the Java forwarder is missing.

@scabug
Copy link
Author

scabug commented Nov 18, 2016

Imported From: https://issues.scala-lang.org/browse/SI-10071?orig=1
Reporter: @dragos
Affected Versions: 2.11.8, 2.12.0

@scabug
Copy link
Author

scabug commented Nov 25, 2016

@dragos said:
Backport to 2.11.x pending.

@scabug scabug closed this as completed Nov 25, 2016
@scabug scabug added this to the 2.12.2 milestone Apr 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants