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
functionfn<T>(val: T){return{ val }}constfnLambda=function<T>(val: T){return{ val }};constarrow=<T,>(val: T)=>({ val });typeAnyFunction=(...args: never[])=>unknown;functionenhance<FnextendsAnyFunction>(fn: Fn): asserts fn is Fn&{enhanced: true}{Object.assign(fn,{enhanced: true}asconst);}(functionrunner1(){enhance(fn);enhance(fnLambda);enhance(arrow);console.log(fn.enhanced)console.log(fnLambda.enhanced)console.log(arrow.enhanced)}())
π Actual behavior
Assertion does not work for function declaration but it works for function expressions / arrow functions.
π Expected behavior
I expect same behavior in all 3 cases.
The text was updated successfully, but these errors were encountered:
Bug Report
π Search Terms
asserts function declaration
β― Playground Link
Playground link with relevant code
π» Code
π Actual behavior
Assertion does not work for function declaration but it works for function expressions / arrow functions.
π Expected behavior
I expect same behavior in all 3 cases.
The text was updated successfully, but these errors were encountered: