title: Kotlin Type mismatch after converted in Android Studio
body: <p>I have tried to convert the existing the android code to Kotlin code. However, it showed the following error</p>
  
  <p><a href="https://i.stack.imgur.com/JmVmx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JmVmx.png" alt="enter image description here"></a></p>
  
  <p>The code before conversion.</p>
  
  <pre><code> recyclerView.setAdapter(new RecyclerView.Adapter() {
              @Override
              public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
                  LayoutInflater layoutInflater = getLayoutInflater();
                  return new RecyclerView.ViewHolder(layoutInflater.inflate(R.layout.item_restaurant2, parent, false)) {
                  };
              }
  
              @Override
              public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
  
              }
  
              @Override
              public int getItemCount() {
                  return 3;
              }
          });
  </code></pre>
  
  <p>The code after conversion. </p>
  
  <pre><code>recyclerView!!.setAdapter(object : RecyclerView.Adapter() {
              override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder {
                  val layoutInflater = layoutInflater
                  return object : RecyclerView.ViewHolder(layoutInflater.inflate(R.layout.item_restaurant2, parent, false)) {
  
                  }
              }
  
              override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
  
              }
  
              override fun getItemCount(): Int {
                  return 3
              }
          })
  </code></pre>