From 2a47d736cb1f89df7b9bc1490a3a9f758276d3ae Mon Sep 17 00:00:00 2001 From: kenji yoshida <6b656e6a69@gmail.com> Date: Sun, 7 Jan 2024 14:24:55 +0900 Subject: [PATCH] fix warnings with Scala 3.4. avoid `private[this]` --- .../routes/compiler/inject/forwardsRouter.scala.twirl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dev-mode/play-routes-compiler/src/main/twirl/play/routes/compiler/inject/forwardsRouter.scala.twirl b/dev-mode/play-routes-compiler/src/main/twirl/play/routes/compiler/inject/forwardsRouter.scala.twirl index 3dc1f794b11..d1a35e7ffb1 100644 --- a/dev-mode/play-routes-compiler/src/main/twirl/play/routes/compiler/inject/forwardsRouter.scala.twirl +++ b/dev-mode/play-routes-compiler/src/main/twirl/play/routes/compiler/inject/forwardsRouter.scala.twirl @@ -35,7 +35,7 @@ class Routes( new Routes(errorHandler, @for(dep <- deps){@dep.ident, }prefix) @cb - private[this] val defaultPrefix: String = @ob + private val defaultPrefix: String = @ob if (this.prefix.endsWith("/")) "" else "/" @cb @@ -54,10 +54,10 @@ class Routes( @for((dep, index) <- rules.zipWithIndex){@dep.rule match { case route @ Route(verb, path, call, comments, modifiers) => { @markLines(route) - private[this] lazy val @routeIdentifier(route, index) = Route("@verb.value", + private lazy val @routeIdentifier(route, index) = Route("@verb.value", PathPattern(List(StaticPart(this.prefix)@if(path.parts.nonEmpty) {, StaticPart(this.defaultPrefix), }@path.parts.map(_.toString).mkString(", "))) ) - private[this] lazy val @invokerIdentifier(route, index) = createInvoker( + private lazy val @invokerIdentifier(route, index) = createInvoker( @if(route.call.passJavaRequest){ (req:play.mvc.Http.Request) => }@injectedControllerMethodCall(route, dep.ident, p => s"fakeValue[${p.typeNameReal}]"), @@ -75,7 +75,7 @@ case route @ Route(verb, path, call, comments, modifiers) => { } case include @ Include(path, router) => { @markLines(include) - private[this] val prefixed_@(dep.ident)_@(index) = Include(@(dep.ident).withPrefix(this.prefix + (if (this.prefix.endsWith("/")) "" else "/") + "@include.prefix")) + private val prefixed_@(dep.ident)_@(index) = Include(@(dep.ident).withPrefix(this.prefix + (if (this.prefix.endsWith("/")) "" else "/") + "@include.prefix")) }}} def routes: PartialFunction[RequestHeader, Handler] = @ob