Hi fellow Scala developers,
Could anyone please explain to me what is wrong with type inference in the following code and how it can be fixed.
The following code is a custom action for Play 2.2 using Scala 2.10.2
class Test {
trait Entity
class NodeRequest[A,K <:Entity](val entity: K,
val request: Request[A])
extends WrappedRequest[A](request)
def LocateResource[A,K](itemId: Int, v: List[K],
forceOwners:Boolean = true) =
new ActionBuilder[NodeRequest[A,K]]() {
def invokeBlock[A](request: Request[A],
block: (NodeRequest[A,K]) => Future[SimpleResult]) = {
Future.successful(Ok)
}
}
[error] Test.this.NodeRequest[A,K] takes no type parameters, expected: one
[error] def LocateResource[A,K](itemId: Int, v: List[K] , forceOwners:Boolean = true) = new ActionBuilder[NodeRequest[A,K]]() {
[error] ^