Skip to content

Array.prototype.filter.not.forcing.boolean.type #7776

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

Conversation

NimaZahedi
Copy link
Contributor

Fixes #
Changed the return value of Array.prototype.filter, use any instead of boolean!
based on this issue: #5850

@msftclas
Copy link

msftclas commented Apr 1, 2016

Hi @NimaZahedi, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!
You've already signed the contribution license agreement. Thanks!

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'.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 runtests
  • jake baseline-accept
  • jake runtests (this should always pass)
  • Then commit

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I though this file should be part of my commit as well! Thanks 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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!?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RyanCavanaugh in the managing the baselines said, these files should be part of the commit 😕

@NimaZahedi NimaZahedi closed this Apr 1, 2016
@NimaZahedi NimaZahedi deleted the Array.prototype.filter.not.forcing.boolean.type branch April 1, 2016 22:27
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants