Re-enable -Werror in the routes-compiler-routes-compilation-java scripted test · Issue #14367 · playframework/playframework · GitHub
Skip to content

Re-enable -Werror in the routes-compiler-routes-compilation-java scripted test #14367

Open

Description

@mkurz

Unlike routes-compiler-routes-compilation, the Java routes fixture routes-compiler-routes-compilation-java doesn't fail on compiler warnings. -Xfatal-warnings was removed in 9105fca (#13004), the same commit that added the 26-parameter /multi-params route. Since then the build only adds -Xlint and similar options on Scala 2. Besides the Scala fixture, routes-compiler-exhaustive-warning, routes-compiler-namespace-reverse-router and routes-compiler-no-package-declaration-in-routes-file also compile with -Werror.

The app and test code of the Java fixture is Java, so scalac only compiles the generated routes code there. Turning fatal warnings back on would check that code for the route shapes that only this fixture has, e.g. ?= null defaults, PATCH/HEAD/OPTIONS routes, or a route with 26 parameters.

Right now two kinds of warnings would make it fail. Both appear in the scripted test logs of #13231 (CI run 38574225740), where the fixture is compiled without -Werror:

  1. Scala 2.13, routes with 22 or more parameters: see Routes with 22 or more parameters: warning on Scala 2.13 with -Xlint, MatchError for null values #14366. This needs a fix in the routes compiler.
  2. Scala 3.9 and Scala 3.next, $ in identifiers: 8 warnings, all from the non-ASCII route controllers.πø$7ß.ôü65$t (conf/routes and app/controllers/πø$7ß.java):
    [warn] -- [E230] Syntax Warning: .../routes/main/controllers/ReverseRoutes.scala:726:8
    [warn] 726 |  class Reverseπø$7ß(_prefix: => String) {
    [warn]     |        ^^^^^^^^^^^^
    [warn]     |The identifier `Reverseπø$7ß` should not contain `$`, which is reserved for internal compiler use.
    
    daaee03 already renamed this to πø7ß.ôü65t in the other fixtures for exactly this warning; the Java fixture was left out.

Scala 3.3.8 compiles the fixture without warnings. The Scala 3.next job in the same run used 3.10.0-RC3 and emitted the same eight $ identifier warnings as Scala 3.9.0 (CI job).

Tasks

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions