title: How to compare two objects and require they have same types?
body: <p>I think it's a very common mistake to compare two objects with different types, e.g.</p>
  
  <pre><code>case class User(name:Option[String])
  
  val user = User(Some("Freewind"))
  
  if(user.name == "Freewind") { // never be true!!!
      ...
  }
  </code></pre>
  
  <p>If there any way to compare two objects while requiring they have same types?</p>