We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
If I try to typecheck the following code:
function construct<T>(constructor: Class<T>): T { return new constructor(); }
I get the following error:
88: return new constructor(); ^^^^^^^^^^^^^^^^^ constructor call. Method cannot be called on 88: return new constructor(); ^^^^^^^^^^^ T
It seems like this code should be valid.
The text was updated successfully, but these errors were encountered:
Flow has now way of knowing what arguments should be passed to constructor
Sorry, something went wrong.
Good point. For my use, this will never be able to be safe (probably without dependent types), so I had to cast constructor to any.
constructor
any
@cameron-martin See: #1409. To avoid any you can pass factory function instead of constructor
No branches or pull requests
If I try to typecheck the following code:
I get the following error:
It seems like this code should be valid.
The text was updated successfully, but these errors were encountered: