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
while the equivalent statement written with the function keyword does not:
functionfoo<P>(bar: P): void{console.log(bar);}
it seems that as long as there is some other statement that precedes the generic declaration, the statement is recognized as valid. this next example is also recognized as valid:
TypeScript Version: 2.3.2
Code
this statement causes an error
while the equivalent statement written with the
function
keyword does not:it seems that as long as there is some other statement that precedes the generic declaration, the statement is recognized as valid. this next example is also recognized as valid:
however, changing the inner function to an arrow function also results in the same error.
Expected behavior:
the expression is evaluated and recognized as valid
Actual behavior:
an error is produced:
The text was updated successfully, but these errors were encountered: