TypeScript Version: nightly (2.1.0-dev.20160826)
Code
typeResult={success: true}|{success: false,error: string}functionhandleError(res: Result){if(res.success===true){return;}res.error;// OK}functionhandleError2(res: Result){if(res.success!==false){return;}res.error;// OK}functionhandleError3(res: Result){if(res.success){return;}res.error;// Property 'error' does not exist on type 'Result'// but should be OK}Expected behavior:
All three cases should behave the same.
TypeScript Version: nightly (2.1.0-dev.20160826)
Code
Expected behavior:
All three cases should behave the same.