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
The type F is parameterized, but when you used it to annotate the type of f, you didn't supply type parameters. In this case, Flow acts as if you had written F<any>. This is why you don't see an error.
Really, these two code snippets are not equivalent. To be equivalent to the latter snippet, you should define F like so: type F = <model:Model>(state:model) => model.
The type F is parameterized, but when you used it to annotate the type of f, you didn't supply type parameters. In this case, Flow acts as if you had written F. This is why you don't see an error.
That behavior seems pretty odd to me because not providing type annotations drops constraint that was defined on the F type which makes me wonder how that is useful ?
In fact I do think that having both type f <x> = () => x and type f = <x> () => x is just going to cause confusion especially if they will have different meanings.
Here is an example code thad should but does not produce errors:
And equivalent with inline type annotations that does error as expected:
The text was updated successfully, but these errors were encountered: