Skip to content

Incorrect Java signature for value classes #10846

Description

@dwijnand

Minimized code

final class Foo(val value: String) extends AnyVal

final class Bar {
  def boxedStringy = Option(new Foo("hi"))
}

Output

$ javap Bar
Compiled from "A.scala"
public final class Bar {
  public Bar();
  public scala.Option<java.lang.String> boxedStringy();
}

Expectation

Scala 2 (2.13.4) is right:

$ javap Bar
Compiled from "A.scala"
public final class Bar {
  public scala.Option<Foo> boxedStringy();
  public Bar();
}

AKA forward-port scala/scala#8127 for Scala 3.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions