TS2368

error TS2368: Type parameter name cannot be ‘number’.

Bad Code ❌

1
2
3
export interface SimpleNumberIndicator<number> {
update(price: T): T;
}

Fixed Code ✔️

The easiest way to fix the error is to make age optional as well:

1
2
3
export interface SimpleNumberIndicator<T = number> {
update(price: T): T;
}