From 6a0dadf46fbbf03c1e1a6f7b6c1d3db2042e2742 Mon Sep 17 00:00:00 2001 From: Dylan Hunn Date: Tue, 14 Dec 2021 15:54:48 -0800 Subject: [PATCH] fix(forms): `_reduceValue` arrow function now has correct types. (#44483) I previously strengthened some weak types in #44370. One of these fixes exposed an incorrect call into `_reduceChildren` from `_reduceValue`. This was caught in google3 by a caller who was extending `FormGroup` and overriding these methods. Special thanks to Bart G for catching this issue and suggesting a fix. PR Close #44483 --- packages/forms/src/model.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/forms/src/model.ts b/packages/forms/src/model.ts index 9ae55af2f7c..c6fd46bc01b 100644 --- a/packages/forms/src/model.ts +++ b/packages/forms/src/model.ts @@ -1914,7 +1914,7 @@ export class FormGroup extends AbstractControl { /** @internal */ _reduceValue() { return this._reduceChildren( - {}, (acc: {[k: string]: AbstractControl}, control: AbstractControl, name: string) => { + {}, (acc: {[k: string]: any}, control: AbstractControl, name: string): any => { if (control.enabled || this.disabled) { acc[name] = control.value; }