I am repeatedly run into a similar problem with Scala IDE. Thanks to tab completion Scala IDE proposes several methods. However, always when I choose a method it complains that it cannot resolve it. In the screenshot, I select the method findByEan
from models.Product
. After selecting the proposed method I get an error message:
Multiple markers at this line
- Line breakpoint:Products [line: 16] - show
- value findByEan is not a member of object models.Product
It complains that .findByEan()
is not part of models.Product
. As you can see from the listing above - the Product object has this method. Of course, it even proposed it to me several seconds ago!
package models
case class Product(ean:Long, name:String, description:String)
object Product{
var products = Set() // some products ...
def find_all = products.toList.sortBy(_.ean)
def findByEan(ean:Long) = products.find(_.ean == ean)
A similar issue happens when I add template views to the controllers.
- Why Scala IDE cannot compile the proposed methods?
Scala IDE Version: 3.0.2-vfinal-20131028-1923-Typesafe