title: Type 'void' is not assignable to object
body: <pre><code>export class LoginInfo {
      userName: string;
      password: string;
  } 
  
  public getLoginInfo(id: number): Promise&lt;LoginInfo&gt; {
      return this.http.get(this.url + id + '/' + '/loginInfo')
          .toPromise()
          .then(response =&gt; response.json() as LoginInfo)
          .catch((error: Response) =&gt; {
              this.handleError(error);
          });
  }
  </code></pre>
  
  <p>Got this code for retrieving data from API controller. When compiling it in ts, I am always getting this error: </p>
  
  <pre><code>Type 'Promise&lt;void | LoginInfo&gt;' is not assignable to type 'Promise&lt;LoginInfo&gt;'
  Type 'void' is not assignable to type 'LoginInfo'
  </code></pre>
  
  <p>Here are my package versions:</p>
  
  <pre><code>"typescript": "2.5.2",
  "@angular/compiler": "4.3.6"
  "@angular/compiler-cli": "4.3.6"
  </code></pre>