Overview
When opening any scala source that uses slicks DBIO.seq, there is an inline error reported that "value seq is not a member of object slick.dbio.DBIO". This appears to be the same issue reported on stack overflow here: http://stackoverflow.com/questions/30436661/error-value-seq-is-not-a-member-of-object-slick-dbio-dbio.
There is, however, no error reported in the problems area. According to @dotta, "it’s 99% a presentation compiler bug"
SBT compiles and runs this example without error.
Steps to reproduce
I tested this in Eclipse Luna and Mars, with the latest ScalaIde 4.1.1. I also tried using oracle jdk7 and jdk8.
- Download the activator-hello-slick project from https://github.com/typesafehub/activator-hello-slick and update to the slick-3.0 branch (https://github.com/typesafehub/activator-hello-slick/tree/slick-3.0)
- Add a project/plugins.sbt with the content
addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "3.0.0")
- Run sbt compile and sbt eclipse
- In eclipse/scalaide, go to import->Existing Projects into Workspace and browse to the root directory of the activator project
- While in the scala perspective, open HelloSlick.scala and inspect line 20
Leave a comment
on 2015-08-06 06:33 *
By Mirco Dotta
This happens consistently and it's easy to reproduce. Just import the project in Eclipse and opening the HelloSlick.scala source. I thought that the empty package was taking a part in this problem, but it turns out it isn't (moving all sources in a proper package doesn't make the wrong error reported by the presentation compiler disappear). As usual with this kind of problems, if the compilation unit containing the definition of `DBIO.seq` is opened, then the presentation compiler correctly typecheck the expression and the error is no longer reported. So, I confirm this is 99% (if not 100%) a presentation compiler issue :-)
Furthermore, if you have Build Automatically **disabled**, when opening the HelloSlick.scala you should also see another error (again only reported by the presentation compiler) saying that both the `Suppliers` and `Coffes` types can't be found. This is likely a different issue, but would be great if this could be fixed as well.
Furthermore, if you have Build Automatically **disabled**, when opening the HelloSlick.scala you should also see another error (again only reported by the presentation compiler) saying that both the `Suppliers` and `Coffes` types can't be found. This is likely a different issue, but would be great if this could be fixed as well.
This is https://issues.scala-lang.org/browse/SI-7139.
Slick has a type alias in a package object with the same name as a module in the package:
git grep -E '(object|type) DBIO'
slick/src/main/scala/slick/dbio/DBIOAction.scala:object DBIO {
slick/src/main/scala/slick/dbio/package.scala: type DBIO[+R] = DBIOAction[R, NoStream, Effect.All]
slick/src/main/scala/slick/lifted/Aliases.scala: type DBIO[+R] = dbio.DBIO[R]
slick/src/main/scala/slick/lifted/Aliases.scala: type DBIOAction[+R, +S <: dbio.NoStream, -E <: dbio.Effect] = dbio.DBIOAction[R, S, E]
It could workaround this with:
package dbio {
class DBIOModule /*renamed */ extends ... { def seq.... }
}
package object dbio {
type DBIO[..] = ..
val DBIO: DBIOModule = new DBIOModule
}
Slick has a type alias in a package object with the same name as a module in the package:
git grep -E '(object|type) DBIO'
slick/src/main/scala/slick/dbio/DBIOAction.scala:object DBIO {
slick/src/main/scala/slick/dbio/package.scala: type DBIO[+R] = DBIOAction[R, NoStream, Effect.All]
slick/src/main/scala/slick/lifted/Aliases.scala: type DBIO[+R] = dbio.DBIO[R]
slick/src/main/scala/slick/lifted/Aliases.scala: type DBIOAction[+R, +S <: dbio.NoStream, -E <: dbio.Effect] = dbio.DBIOAction[R, S, E]
It could workaround this with:
package dbio {
class DBIOModule /*renamed */ extends ... { def seq.... }
}
package object dbio {
type DBIO[..] = ..
val DBIO: DBIOModule = new DBIOModule
}
on 2015-08-06 08:50 *
By Mirco Dotta
@16bytes Unfortunately, it looks like this is a known problem, and Jason said he was unable to fix this one. I'm closing this ticket as there is already an existing ticket for it in the upstream project https://issues.scala-lang.org/browse/SI-7139.
No file chosen
You have an empty file field. Please select or remove it.
Name | Size | ||
---|---|---|---|
scala-ide-bug.png | 55.7 KB | Added by 16bytes on 2015-08-05 - Upload new version |