Skip to content

Regression in playframework/playframework for access to private static class public members #21599

Closed as not planned
@WojciechMazur

Description

@WojciechMazur

Based on Open CB failure in playframework/playframework - builds logs

Compiler version

3.6.0-RC1-bin-20240915-ad8c21a-NIGHTLY
Bisect points to e7d479f / #21362

Minimized code

import java.util.List;

public class RoutingDsl {

  final List<Route> routes = null;

  static class Method {}
  private static class Route {
    final Method actionMethod = null;
  }
}
@main def Test =
  val x: RoutingDsl = ???
  x.routes.forEach: route =>
    println(route.actionMethod) // error

Output

Compiling project (Scala 3.6.0-RC1-bin-20240915-ad8c21a-NIGHTLY, JVM (17))
[error] ./test.scala:4:13
[error] Unable to emit reference to value actionMethod in class Route, class Route is not accessible in the top-level definitions in package <empty>
[error]     println(route.actionMethod)
[error]             ^^^^^

Expectation

Should compile. This code does compile in Scala 3.5.0 and lower. It also compiles in Scala 2.12/2.13

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions