title: Not enough information to infer parameter T
body: <p><code>Context</code>: I am building a REST API with kotlin using Spring
  <code>Problem</code>: I have a Kotlin class called <code>Response</code> that accepts a generic like this:</p>
  
  <pre><code>class Response&lt;T&gt; {
  
      var data: T? = null
      var dataArray: List&lt;T&gt;? = null
      var errors: List&lt;String&gt;? = null
          get() {
              if (field == null) {
                  this.errors = ArrayList()
              }
              return field
          }
  }
  </code></pre>
  
  <p><strong>When I try to instantiate in one of my <code>API Controllers</code> like this:</strong></p>
  
  <pre><code>val response = Response()
  response.setData(someting)
  </code></pre>
  
  <p>It gives me <code>Not enough information to infer parameter T</code>.</p>
  
  <p>How can I avoid this error?</p>