I'm in the process of migrating to Slick 2.0.0-RC1 (from 1.x), and I'm having trouble getting IntelliJ to recognize the lifted embedding implicits around the TableQuery
statements. However, everything does compile, in both IntelliJ and sbt (read: play). I started by leveraging the new code generation feature, and just now I grabbed snippets from slick-examples verbatim — both produce the same behavior.
Using the first example of lifted embedding (https://github.com/slick/slick-examples/blob/master/src/main/scala/com/typesafe/slick/examples/lifted/FirstExample.scala) the following two things occur:
The line:
def supplier = foreignKey("SUP_FK", supID, suppliers)(_.id)
Produces an error on
suppliers
sayingType mismatch, expected: TableQuery[NotInferredTT], actual: ((Tag) => FirstExample.Suppliers) => TableQuery[FirstExample.Suppliers]
The
TableQuery[...]
vals (e.g., coffees) don't have any of the lifted collection-like operations on them (e.g., filter, map, take, etc.).
Weirdly enough, using for-comprehensions doesn't produce any errors, however nothing has the right type information (ends up as an Any
).
I'm positive that I've got the .simple._
import (it doesn't compile elsewhere without it). I've cleared all my caches, rerun my gen-idea, done full rebuilds, etc. with no progress. I'm running IntelliJ 12.1.6 Ultimate with the Scala 0.22.302 plugin. My own project uses SQLServer, but I tried the example with H2 and experienced the same thing.
Can someone point me in the right direction?
TableQuery
(e.g.,val suppliers = TableQuery[Suppliers](tag => new Suppliers(tag))
), everything starts working as expected. Am I doing something stupid here? – Richard Pianka