I run Play Framework 2.2.1. I used to have only java controllers rendering templates. Now I am adding a Scala controller to render a new template indexScala.scala.html. The parameters list for indexScala.scala.html:
@()(implicit request: play.api.mvc.RequestHeader)
and it calls
@mainEmptyScala("blah", head) {}
The parameters list for mainEmptyScala.scala.html:
@(title: String, head: Html = Html(""))(body: Html)(implicit request: play.api.mvc.RequestHeader)
When I call indexScala template, I also declare request as implicit in the Scala controller. However, I got this compile error.
[error] ~/myapp/app/views/indexScala.scala.html:29: ambiguous implicit values:
[error] both method requestHeader in object PlayMagicForJava of type => play.api.mvc.RequestHeader
[error] and value request of type play.api.mvc.RequestHeader
[error] match expected type play.api.mvc.RequestHeader
[error] @mainEmptyScala("blah", head) {
[error] ^
I made sure that indexScala and mainEmptyScala templates are not called by any Java controller, so PlayMagicForJava shouldn't be used. Does anybody know how to resolve this compile error? Thanks.