diff --git a/src/compiler/core.ts b/src/compiler/core.ts index 42faf0b062e..97b642d8920 100644 --- a/src/compiler/core.ts +++ b/src/compiler/core.ts @@ -703,7 +703,8 @@ namespace ts { export function sum, K extends string>(array: T[], prop: K): number { let result = 0; for (const v of array) { - result += (v[prop] as number); + // Note: we need the following type assertion because of GH #17069 + result += v[prop] as number; } return result; }