Remove type assertion in sum function (#22670)

This commit is contained in:
AdityaDaflapurkar 2018-03-19 20:49:24 +05:30 committed by Andy
parent c48662c891
commit 76fefddcaa

View File

@ -920,8 +920,7 @@ namespace ts {
export function sum<T extends Record<K, number>, K extends string>(array: ReadonlyArray<T>, prop: K): number {
let result = 0;
for (const v of array) {
// TODO: Remove the following type assertion once the fix for #17069 is merged
result += v[prop] as number;
result += v[prop];
}
return result;
}