Which @angular/* package(s) are the source of the bug?
core
Is this a regression?
No
Description
inject()'s type description seems to be invalid:
|
export function ɵɵinject<T>(token: ProviderToken<T>): T; |
|
export function ɵɵinject<T>(token: ProviderToken<T>, flags?: InjectFlags): T|null; |
|
export function ɵɵinject<T>(token: ProviderToken<T>, flags = InjectFlags.Default): T|null { |
Return type should be T | null only if flag is set to InjectFlags.Optional meaning that the signature should be something like this:
export function ɵɵinject<T>(token: ProviderToken<T>): T;
export function ɵɵinject<T>(token: ProviderToken<T>, flags?: InjectFlags.Default | InjectFlags...): T;
export function ɵɵinject<T>(token: ProviderToken<T>, flags?: InjectFlags.Optional): T | null;
export function ɵɵinject<T>(token: ProviderToken<T>, flags = InjectFlags.Default): T|null
Please provide a link to a minimal reproduction of the bug
No response
Please provide the exception or error you saw
No response
Please provide the environment you discovered this bug in (run ng version)
No response
Anything else?
No response
Which @angular/* package(s) are the source of the bug?
core
Is this a regression?
No
Description
inject()'s type description seems to be invalid:angular/packages/core/src/di/injector_compatibility.ts
Lines 78 to 80 in 5cfde8b
Return type should be
T | nullonly if flag is set toInjectFlags.Optionalmeaning that the signature should be something like this:Please provide a link to a minimal reproduction of the bug
No response
Please provide the exception or error you saw
No response
Please provide the environment you discovered this bug in (run
ng version)No response
Anything else?
No response