You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
typeUpdateMessage={message: any}typeUpdateInlineQuery={inline_query: any}typeUpdateCallbackQuery={callback_query: any}typeUpdate=UpdateMessage|UpdateInlineQuery|UpdateCallbackQueryfunctionisMessage(x: Update): x is UpdateMessage{return(<UpdateMessage>x).message!==undefined;}functionisInlineQuery(x: Update): x is UpdateInlineQuery{return(<UpdateInlineQuery>x).inline_query!==undefined;}functionisCallbackQuery(x: Update): x is UpdateCallbackQuery{return(<UpdateCallbackQuery>x).callback_query!==undefined;}functioncheckType(u: Update){switch(true){caseisMessage(u):
console.log('message',u);break;caseisInlineQuery(u):
console.log('inline query',u);break;caseisCallbackQuery(u):
console.log('callback query',u)break;default:
console.log('unknown type',u)}}
Expected behavior:
caseisMessage(u):
u.bad_type// Property 'bad_type' does not exist on type 'UpdateMessage'.console.log('message',u);break;caseisInlineQuery(u):
u.bad_type// Property 'bad_type' does not exist on type 'UpdateInlineQuery'.console.log('inline query',u);break;
Actual behavior:
caseisMessage(u):
u.bad_type// Property 'bad_type' does not exist on type 'UpdateMessage'.console.log('message',u);break;caseisInlineQuery(u):
u.bad_type// Property 'bad_type' does not exist on type 'UpdateMessage'.console.log('inline query',u);break;
The text was updated successfully, but these errors were encountered:
TypeScript Version: nightly (2.2.0-dev.20161124)
Code
Expected behavior:
Actual behavior:
The text was updated successfully, but these errors were encountered: