title: Overriding equals method in Scala
body: <p>I have the following code. When compiling I get an error saying</p>
  
  <p><code>value email is not a member of Player</code></p>
  
  <pre><code>class Player(email: String)
  {
    override def equals(player: Any): Boolean = {
      player match {
        case p: Player =&gt; email.equals(p.email)
        case _ =&gt; false
      }
    }
  }
  </code></pre>
  
  <p>I am a Java programmer trying out Scala and can't figure out why this error is occuring (From what I understand email is a member of player instance). Can someone give an explanation and how to solve this problem?</p>