eclipse - Type error when mocking Slick Query using ScalaMock: what does "some other" mean? -
i have used java several years, i'm new scala , still trying figure out type system. i'm using scala 2.10.2, slick 1.0.1, , scalamock 2.10-3.0-m4 in eclipse scala ide 3.0.1
i'm trying mock out slick in updatenamebyid
using scalamock.
def updatenamebyid(id: int, input: string, users: richtable[object]) = { users.where(_.id === id).map{ e => e.test }.update(input) } abstract class richtable[t](name: string = "blank") extends slick.driver.mysqldriver.simple.table[t](name) { def id = column[int]("id", o.primarykey, o.autoinc) def test = column[string]("test") }
(i'm passing in users: richtable[user] user has complex inheritance hierarchy, i've temporarily removed uses of user simplify example)
users.where
returns scala.slick.lifted.query
, try mock out follows
class modeltest extends flatspec mockfactory { def test = { val mockusers = mock[richtable[object]] // mockquery definition val mockquery = mock[scala.slick.lifted.query[richtable[object], scala.slick.lifted.nothingcontainer#tablenothing]] (mockusers.where _).expects(*).returns(mockquery) main.updatenamebyid(1, "asdf", mockusers) } }
the mockquery definition gives me these cryptic type errors
type mismatch; found : scala.slick.lifted.query[o(in method union), scala.slick.lifted.nothingcontainer#tablenothing] required: scala.slick.lifted.query[(some other)o(in method union), scala.slick.lifted.nothingcontainer#tablenothing] type mismatch; found : scala.slick.lifted.query[o(in method unionall), scala.slick.lifted.nothingcontainer#tablenothing] required: scala.slick.lifted.query[(some other)o(in method unionall), scala.slick.lifted.nothingcontainer#tablenothing]
i have no idea "o(in method union[all])" vs. "(some other)o(in method union[all])" means, , google hasn't been (it doesn't matters "some other" extremely generic phrase - googling "scala other type error" produces pretty same results "scala type error"). know means and/or how fix type error?
Comments
Post a Comment