Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Play Framework 2.1 - template arguments type parameters

In my template I would like to use a bounded type parameter instead of an exact type:

@(myForm: Form[T])

where T is like T <: MyType

so as to make it more generic in use. However, I cannot find a way to specify this kind of behavior. How can I do this?

like image 341
noncom Avatar asked Dec 21 '12 09:12

noncom


1 Answers

You can use

Form[_ <: MyType]

That way you can pass in any Form with a type parameter that extends MyType.

like image 153
Kim Stebel Avatar answered Sep 19 '22 11:09

Kim Stebel