Skip to content

bug(CORE): HasErrorState interface has incorrect types #28688

Closed
@Akxe

Description

@Akxe

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

The HasErrorState interface used in mixinErrorState do require _parentFormGroup and _parentForm to be non-null. But the _ErrorStateTracker that is using it does not care.

Reproduction

StackBlitz link: https://stackblitz.com/edit/components-issue-ovhttn?file=src%2Fapp%2Fexample-component.ts
Steps to reproduce:

  1. Build
  2. See error

Expected Behavior

The HasErrorState interface should mimic type requirements from _ErrorStateTracker and therefore work.

Actual Behavior

Error that _parentFormGroup and _parentForm cannot be null.

Environment

Angular CLI: 17.2.0
Node: 20.10.0
Package Manager: npm 10.2.5
OS: win32 x64

Angular: 17.2.1
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package Version

@angular-devkit/architect 0.1702.1
@angular-devkit/core 17.2.1
@angular-devkit/schematics 17.2.0
@angular/cdk 17.2.0
@angular/cli 17.2.0
@angular/material 17.2.0
@schematics/angular 17.0.3
rxjs 7.8.1
typescript 5.3.3
zone.js 0.14.3

Metadata

Metadata

Assignees

Labels

P4A relatively minor issue that is not relevant to core functionsarea: material/core

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions