0

I am trying to use a small snippet of Shapeless example code:

  import shapeless._

  case class Person(name : String, age : Int)
  val ageLens = lens[Person].age
  val person = Person("Joe Grey", 37)
  val person2 = ageLens.set(person)(38) // Error: Cannot find set method

For some reason it cannot find the set method. Why not?

This code is straight from the examples here: https://github.com/milessabin/shapeless/blob/master/examples/src/main/scala/shapeless/examples/lenses.scala

BAR
  • 15,909
  • 27
  • 97
  • 185
  • Your code works fine in my environment: Scala 2.11.7, Shapeless 2.2.5, Java 1.8.0_45. Can you write your build.sbt file, and sofware versions you are using ? – ymonad Sep 10 '15 at 06:28
  • @ymonad Same specs. Running SBT 0.13.8 – BAR Sep 10 '15 at 06:36
  • @ymonad I ended up getting this to run, but intellJ is saying there is an error. I think this might be an intelliJ bug. – BAR Sep 10 '15 at 06:57
  • Congrats. I should have ask "How did you get the error". I was using `vim` as editor and `sbt console` to check the behavior. – ymonad Sep 10 '15 at 07:11
  • @ymonad Thanks. I think you asked the right question. This is the first time I have ever seen an IntelliJ error like this (I am on the EAP branch). – BAR Sep 10 '15 at 07:13

0 Answers0