title: Scala - error "value map is not a member of"
body: <p>Using Scala, I have got this error "value map is not a member of chemins.Point"
  point &lt;- segment.to</p>
  
  <p>Here is my code : </p>
  
  <pre><code>package chemins
  
  case class Point(name: String, x: Long, y: Long)
  
  case class Segment(from: Point, to: Point) {
    def distance: Double = {
  
      math.sqrt((from.x - to.x)*(from.x - to.x) + (from.y - to.y)*(from.y - to.y))
    }
  
  }
  
  case class Path(segments: Vector[Segment]) {
  
    def length: Double = {
  
      (for {
  
        segment &lt;- segments
  
      } yield segment.distance).sum
  
    }
  
    def stops : Vector[Point] = {
  
      for {
        segment &lt;- segments
        point &lt;-  segment.to
      } yield point
    }
  
  
  }
  </code></pre>
  
  <p>From my previous search, it seems to come from the fact that "to" has no generator but I have no clues if it's relevant.</p>
  
  <p>Thanks !</p>