title: How to pass data class as parameter in kotlin extension
body: <p>i have a data class like:</p>
  
  <pre><code>data class GetDoctorResponse(
      val BrickName: String,
      val Class: String,
      val DoctorAddress
  )
  </code></pre>
  
  <p>Now i want to get response, so i get it like this:</p>
  
  <pre><code>val myResponse = Gson().fromJson("response in json", Array&lt;GetDoctorResponse&gt;::class.java).toList()
  </code></pre>
  
  <p>my question is how can i create an extension which takes data and class and return me response like above.</p>
  
  <p>i have tried this:</p>
  
  <pre><code>fun getResponse(data: String, it: Class&lt;T&gt;) : List&lt;it&gt; =
      Gson().fromJson(data, Array&lt;it&gt;::class.java).toList()
  </code></pre>
  
  <p>but T is unresolved here, and i want to get response of any data class i passed.</p>
  
  <pre><code>val response = getResponse(data, SomeClass())
  </code></pre>