Array.prototype.filter.not.forcing.boolean.type#7776
Conversation
|
Hi @NimaZahedi, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution! The agreement was validated by Microsoft and real humans are currently evaluating your PR. TTYL, MSBOT; |
|
|
||
| foo.filter(x => x.name); //should accepted all possible types not only boolean! | ||
| ~~~~~~~~~~~ | ||
| !!! error TS2345: Argument of type '(x: { name: string; }) => string' is not assignable to parameter of type '(value: { name: string; }, index: number, array: { name: string; }[]) => boolean'. |
There was a problem hiding this comment.
What is this error doing here? It seems like this baseline file shouldn't exist.
The correct order of operations is:
- Make your change
jake runtestsjake baseline-acceptjake runtests(this should always pass)- Then commit
There was a problem hiding this comment.
Ok, I though this file should be part of my commit as well! Thanks 👍
There was a problem hiding this comment.
@RyanCavanaugh btw, I made another branch and did exactly the flow that you said ^^, I run jake runtests for second time and it was passed, but still there was that file(arrayFilter.errors.txt) in my git which I thought should be part of my commit! anyway, I commit without that! but I want to know is it correct?! I mean shouldn't be deleted by jake runtests!?
There was a problem hiding this comment.
@RyanCavanaugh in the managing the baselines said, these files should be part of the commit 😕
Fixes #
Changed the return value of Array.prototype.filter, use any instead of boolean!
based on this issue: #5850