Incorrect method match in typescript
I have next line of code
env.stateHandler.pushState(env.states.featureSplash)
It produces a warning "Invalid number of arguments, expect 2..3".
When i click on pushState, it refers to pushState method of History interface in lib.dom.d.ts
And this line of code doesn`t produce error above
(env.stateHandler.pushState)(env.states.featureSplash)
It just a warning so it doesn't matter so much, but it's unpleasant :)
Please sign in to leave a comment.
But why is it incorrect? This function does indeed expect 2-3 arguments, you will get similar error from compiler when passing a single argument to it:
Thanks for answering.
Problem is in incorrect referencing
is my custom method that receive only one parameter, but it somehow referencing to method with same name in History interface (im not using it in my project at all)
If i use parentheses, webstorm correctly recognize my method, but not without them
then the actual issue is that your local method can't be resolved for some reason.
Sample project/files the problem can be reproduced with would be helpful