Closed
Description
Reproduction
- Click on the mont-year button.
- Click on the year.
- Error is logged in the console.
- Click on the month.
- Another error logged.
The date picker calendar has code like:
const view = this._getCurrentViewComponent();
if (view) {
view._init();
}
where the getCurrentViewComponent
is:
private _getCurrentViewComponent() {
return this.monthView || this.yearView || this.multiYearView;
}
Each view is a non-null property on the class, so TypeScript infers that the return type is typeof this.monthView
and tsickle propagates that to calendar.closure.js. Then the JavaScript compiler assumes that view._init
call is always the function from monthView and optimizes code to only that.
Expected Behavior
No errors.
Actual Behavior
Errors are logged to the console:
- RangeError: Invalid time value
- TypeError: a.v is not a function
Environment
- Angular: n/a
- CDK/Material: n/a
- Browser(s): n/a
- Operating System (e.g. Windows, macOS, Ubuntu): n/a