Skip to content

Type checker complains about valid Java code #7959

@travisbrown

Description

@travisbrown

minimized code

public class Test {
  private static class Foo {
    Foo() {}
  }
}
Compilation output
-- Error: Test.java:3:4 --------------------------------------------------------
3 |    Foo() {}
  |    ^
  |    non-private constructor Foo in class Foo refers to private class Foo
  |    in its type signature (): Test.Foo
1 error found

expectation

The Java compiler is happy to accept this code, and this is minimized from a mixed Scala and Java project that I'm trying to migrate from Scala 2 where this Java code has never been a problem.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions