You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The biggest roadblock I see for this are the TemplateN traits that have the abstract render methods. For example:
trait Template1[A, Result] {
def render(a: A): Result
}
It seems like render is mostly a Play-Java thing, as I've rarely (if ever) have seen it used from Scala code, and unless I'm mistaken, it seems like an alias to apply, with the exception that it's required by these template traits, where apply actually isn't. Anyway, the issue arises where if we want a template with this signature:
@[A](list: List[A])
It should compile to have an apply method that looks like
def apply[A](list: List[A]): Html
But then render also needs to include the type parameter A in it's signature to call apply, but it can't because then the signature required by Template1 would be left unimplemented. I was able to get some basic examples working by cutting out the TemplateN traits, but this is a pretty big API change, so I can't really proceed without some guidance.
Activity
gmethvin commentedon Dec 2, 2017
Would be an interesting feature if someone wants to implement it.
mhzajac commentedon Jun 13, 2018
The biggest roadblock I see for this are the
TemplateNtraits that have the abstractrendermethods. For example:It seems like
renderis mostly a Play-Java thing, as I've rarely (if ever) have seen it used from Scala code, and unless I'm mistaken, it seems like an alias toapply, with the exception that it's required by these template traits, whereapplyactually isn't. Anyway, the issue arises where if we want a template with this signature:It should compile to have an apply method that looks like
But then
renderalso needs to include the type parameterAin it's signature to callapply, but it can't because then the signature required byTemplate1would be left unimplemented. I was able to get some basic examples working by cutting out theTemplateNtraits, but this is a pretty big API change, so I can't really proceed without some guidance.mkurz commentedon Nov 10, 2018
Also see #37
mkurz commentedon Dec 10, 2025