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
Infer Type Guard Return Values #5101 when a function's return expression is a recognized type guard (e.g. x instanceof y), automatically infer the function itself to be a type guard
👍 Accepting PRs. Do we have any other pending type guard work?
Infer Type Guard Return Values #5101 when a function's return expression is a recognized type guard (e.g. x instanceof y), automatically infer the function itself to be a type guard
Too complex, low-yield. Write isFoo separately (and generically?) to get this to work
Activity
RyanCavanaugh commentedon Oct 5, 2015
nameofoperatormemberofproposal we have floating around somewheresupercallthisin lexically-beforesupercallsconstructorproperty of classes should point to the static side of the classvar x: typeof expr[0](useful for arrays and tuples)lets inforloopsbreakin this case, but allow standardbreakvars in the bodynoImplicitAnyvoidparameters to be omitted in function callstypeof x==='function'or'object')returnexpression is a recognized type guard (e.g.x instanceof y), automatically infer the function itself to be a type guardisFooseparately (and generically?) to get this to work