1
votes

I've just upgraded my Scala project to Slick 2.1 and I got a compilation error due to a change in Query class definition. It changed from Query[+E, U] to Query[+E, U, C[_]].

I have a method that takes as argument a Query type that I defined as Query[Links,Link] where Link and Links are defined as

case class Link( /* properties */)

class Links(tag: Tag) extends Table[Link](tag, "crawled_url") { /* methods*/ }

I don't get how to declare the C[_] type parameter in order to get my method to compile

def takeLimit(query: Query[Links,Link,??], limit: Int) = { /* do stuff */}

Here's the link to the source file of Query class in Slick's master repository

https://github.com/slick/slick/blob/master/src/main/scala/scala/slick/lifted/Query.scala

1
It is the type constructor for the unpacked collection type.rightfold

1 Answers

3
votes

C[_] is the underlying collection type that slick will return.

It was added in 2.1.0: http://slick.typesafe.com/doc/2.1.0-RC3/upgrade.html

In your case you can probably change your method signature to this:

def takeLimit(query: Query[Links,Link,Seq], limit: Int) = { /* do stuff */}