Skip to content

Declare 'sum' so that it doesn't require type arguments. #17079

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

Merged
merged 2 commits into from
Jul 12, 2017

Conversation

DanielRosenwasser
Copy link
Member

Addresses concerns raised in #16823.

let result = 0;
for (const v of array) {
result += v[prop];
result += (v[prop] as number);
Copy link

@ghost ghost Jul 10, 2017

Choose a reason for hiding this comment

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

Parens shouldn't be necessary. Might want to add a comment linking to the issue. (#17069)

@DanielRosenwasser DanielRosenwasser merged commit 38f6db5 into master Jul 12, 2017
@DanielRosenwasser DanielRosenwasser deleted the noTypeArgsSum branch July 12, 2017 07:10
@microsoft microsoft locked and limited conversation to collaborators Jun 14, 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