title: Scala compiler error : only classes can have declared but undefined members
body: <p>Below class throws a compiler error at this line <code>val userList : List[User]</code> : </p>
  
  <pre><code>Multiple markers at this line
      - only classes can have declared but undefined members
      - only classes can have declared but undefined members
  </code></pre>
  
  <p>Here is the entire code : </p>
  
  <pre><code>class SimilarityData {
  
    case class User(id: String, jCoeff : Int) 
  
    def getUsers() =
    {    
      val userList : List[User]
      userList :+ new User("1" , 1);    
    }
  
  }
  </code></pre>
  
  <p>What is causing this error ?</p>