Skip to content

Public constructors for singletons leak into class files #6834

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

Closed
anatoliykmetyuk opened this issue Jul 10, 2019 · 0 comments
Closed

Public constructors for singletons leak into class files #6834

anatoliykmetyuk opened this issue Jul 10, 2019 · 0 comments

Comments

@anatoliykmetyuk
Copy link
Contributor

object Foo

When compiled with Dotc:

MacBook-Pro-Anatolii:dotty anatolii$ javap Foo$.class
Compiled from "Playground.scala"
public final class Foo$ implements scala.Serializable {
  public static final Foo$ MODULE$;
  public static {};
  public Foo$();
}

When compiled with Scalac:

MacBook-Pro-Anatolii:issues anatolii$ javap Foo\$.class
Compiled from "Playground.scala"
public final class Foo$ {
  public static Foo$ MODULE$;
  public static {};
}

This breaks logic that depends on class file analysis. E.g. mill test discovery.

anatoliykmetyuk added a commit to dotty-staging/dotty that referenced this issue Jul 11, 2019
anatoliykmetyuk added a commit that referenced this issue Jul 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant