title: Optional generic type
body: <p>I have the following logging method:</p>
  
  <pre><code>  private logData&lt;T, S&gt;(operation: string, responseData: T, requestData?: S) {
      this.logger.log(operation + ' ' + this.url);
      if (requestData) {
        this.logger.log('SENT');
        this.logger.log(requestData);
      }
      this.logger.log('RECEIVED');
      this.logger.log(responseData);
      return responseData;
    }
  </code></pre>
  
  <p>The <code>requestData</code> is optional, I want to be able to call <code>logData</code> without having to specify the <code>S</code> type when I don't send the <code>requestData</code> to the method: instead of: <code>this.logData&lt;T, any&gt;('GET', data)</code>, I want to call <code>this.logData&lt;T&gt;('GET', data)</code>.</p>
  
  <p>Is there a way to achieve this?</p>