Play migration to 2..6 and Scala 2.12 : Compilation issue while using WithFilter

Recently I have upgraded the play to 2.6 and scala to 2.12. Below code was working fine with previous version, but now its trowing compilation error in upgraded version.

object Global extends WithFilters {

override def doFilter(next: EssentialAction): EssentialAction = {
Filters(super.doFilter(next), CustomOverridingFilter)
}

override def onError(request: RequestHeader, throwable: Throwable) = {
//Some code here
super.onError(request, throwable)
}

override def onStart(app: Application) = {
//Some code here
super.onStart(app)
}

override def onStop(app: Application) = {
//Some Code Here
}
}

object CustomOverridingFilterextends Filter {

override def apply(nextFilter: (RequestHeader) => Future[Result])
(requestHeader: RequestHeader): Future[Result] = {
//Some Code Here
}
}

Getting Compilation error as below: not found: type WithFilters value doFilter is not a member of AnyRef value onStart is not a member of AnyRef

Play : 2.6 Scala: 2.12

Can someone please help me. Any suggestion how to rewrite to support the newer scala 2.12.

Hi @lokanathnayak,
I assume WithFilters was deprecated at some point and I guess was removed.
It’d be a good idea to mention which version of Play you are migrating from so that it helps to find the right migration guide.
You might be able to find some useful information here.
Cheers

Hi,
I am using Play 2.6 with Scala 2.12.
I understand that the WithFilter is depreciated but not getting a way like how can I rewrite the above code to support scala 2.12.

Any dummy code snippet.