-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
t.throw flow type check is giving a false-positive (Callable signature not found in) #1148
Comments
pinging @thejameskyle |
Can this be marked as a bug? I am not sure how to fix it... I would raise a PR otherwise. It is breaking our integration tests. Annoyingly, I cannot even use |
Taking a look - I'm not 100% sure what's wrong, but the js.flow file seems like it might be double-defining the throws type. |
A simpler repro case is simply:
Which yields:
|
Instead of double-defining each of these, define them once while using overloading. Also took some liberties to improve the definition. Specifically, ava doesn't care what values these throwing functions return, but doesn't produce a return value. Fixes avajs#1148
Instead of double-defining each of these, define them once while using overloading. Also took some liberties to improve the definition. Specifically, ava doesn't care what values these throwing functions return, but doesn't produce a return value. Fixes avajs#1148
Instead of double-defining each of these, define them once while using overloading. Also took some liberties to improve the definition. Specifically, ava doesn't care what values these throwing functions return, but doesn't produce a return value. Fixes avajs#1148
Instead of double-defining each of these, define them once while using overloading. Also took some liberties to improve the definition. Specifically, ava doesn't care what values these throwing functions return, but doesn't produce a return value. Fixes #1148
Description
I am getting an "Callable signature not found in" when using
t.throws
.The type error originates in the
node_modules/ava/index.js.flow
definition.This could be simply me misunderstanding what the error is saying.
I'd expect Flow to pickup:
annotation and ignore:
I even explicitly cast the result to
Promise<void>
.If I remove the
Promise<void>
cast, I am getting a different error, https://gist.github.com/gajus/5c42f0262874a2bae7842691eea28a60#file-ava-flow-sh-L2.Test Source
Error Message & Stack Trace
Config
Copy the relevant section from
package.json
:Command-Line Arguments
Environment
Tell us which operating system you are using, as well as which versions of Node.js, npm, and AVA. Run the following to get it quickly:
The text was updated successfully, but these errors were encountered: