Skip to content

Commit

Permalink
Merge pull request #12284 from xuwei-k/patch-3
Browse files Browse the repository at this point in the history
fix warnings with Scala 3.4. avoid `private[this]`
  • Loading branch information
mkurz committed Feb 21, 2024
2 parents d920994 + 2a47d73 commit 00ffdc0
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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}]"),
Expand All @@ -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
Expand Down

0 comments on commit 00ffdc0

Please sign in to comment.