title: scala type mismatch. found type, required _$1
body: <p>I'm getting a compiler error that I don't understand. The code below produces the following error:</p>
  
  <p>error: type mismatch;
   found   : oldEntity.type (with underlying type com.mycompany.address.AddressEntity)
   required: <em>$1
      this.esDocsForAddressEntity.filter(</em>.shouldTriggerRefresh(oldEntity, newEntity)).map(_.esDocName)</p>
  
  <pre><code>object AddressToEsDocMapper {
  
  
    private val esDocsForAddressEntity = List[EsDocRefreshTrigger[_]](new PartyAddressRefreshTrigger())
  
  
    def findEsDocsForUpdate(oldEntity : AddressEntity, newEntity : AddressEntity) : List[String] = {
      this.esDocsForAddressEntity.filter(_.shouldTriggerRefresh(oldEntity, newEntity)).map(_.esDocName)
    }
  
  
    private class PartyAddressRefreshTrigger extends EsDocRefreshTrigger[AddressEntity] {
  
      val esDocName = "PartyAddress"
  
      override def shouldTriggerRefresh(oldEntity : AddressEntity, newEntity : AddressEntity) : Boolean = {
        oldEntity.addressLine2 != newEntity.addressLine2 || 
        oldEntity.addressLine3 != newEntity.addressLine3 || 
        oldEntity.addressLine1 != newEntity.addressLine1
      }
  
    }
  
  }
  </code></pre>