Title: Invalid `inject()` function typing · Issue #46251 · angular/angular · GitHub
Open Graph Title: Invalid `inject()` function typing · Issue #46251 · angular/angular
X Title: Invalid `inject()` function typing · Issue #46251 · angular/angular
Description: 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 export fun...
Open Graph Description: 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...
X Description: 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_compatibi...
Opengraph URL: https://github.com/angular/angular/issues/46251
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Invalid `inject()` function typing","articleBody":"### Which @angular/* package(s) are the source of the bug?\n\ncore\n\n### Is this a regression?\n\nNo\n\n### Description\n\n`inject()`'s type description seems to be invalid:\r\nhttps://github.com/angular/angular/blob/5cfde8b23e72cff4c9359f765a462b474bb32631/packages/core/src/di/injector_compatibility.ts#L78-L80\r\n\r\nReturn type should be `T | null` only if flag is set to `InjectFlags.Optional` meaning that the signature should be something like this:\r\n\r\n```typescript\r\n export function ɵɵinject\u003cT>(token: ProviderToken\u003cT>): T; \r\n export function ɵɵinject\u003cT>(token: ProviderToken\u003cT>, flags?: InjectFlags.Default | InjectFlags...): T; \r\n export function ɵɵinject\u003cT>(token: ProviderToken\u003cT>, flags?: InjectFlags.Optional): T | null; \r\n export function ɵɵinject\u003cT>(token: ProviderToken\u003cT>, flags = InjectFlags.Default): T|null\r\n```\n\n### Please provide a link to a minimal reproduction of the bug\n\n_No response_\n\n### Please provide the exception or error you saw\n\n_No response_\n\n### Please provide the environment you discovered this bug in (run `ng version`)\n\n_No response_\n\n### Anything else?\n\n_No response_","author":{"url":"https://github.com/yjaaidi","@type":"Person","name":"yjaaidi"},"datePublished":"2022-06-03T20:56:28Z","url":"https://github.com/angular/angular/issues/46251"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:707a00b0-0fe7-4382-db68-a09b3515ffdf |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8560:10531B:781D9:98DE0:6B00F551 |
| html-safe-nonce | cac4e6a6e8912385a9fa3e3f62e8508cfb46ed36a22eb1648fb0fdb916a367b7 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NTYwOjEwNTMxQjo3ODFEOTo5OERFMDo2QjAwRjU1MSIsInZpc2l0b3JfaWQiOiIxNjQ3NzM1NjYwNTUyOTc1Njk3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 96e7adb507ef984c2fefcff551b14c28b6ef7b5a5160e4078efef3625aa4cb99 |
| hovercard-subject-tag | issue:1260370712 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular/46251/issue_layout |
| twitter:image | https://opengraph.githubassets.com/61ea98562b02abdef6c763f9dd9919927e0b9390f802b3bc1e15badea455f13d/angular/angular/issues/46251 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/61ea98562b02abdef6c763f9dd9919927e0b9390f802b3bc1e15badea455f13d/angular/angular/issues/46251 |
| og:image:alt | 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... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | yjaaidi |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4ef498cbabcbe3c50befc7a5b743e7072ee770b4daf0e15e54801180d1fa91fc |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angular git https://github.com/angular/angular.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 24195339 |
| octolytics-dimension-repository_nwo | angular/angular |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 24195339 |
| octolytics-dimension-repository_network_root_nwo | angular/angular |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 9983dd5da06943f833c971dd5b6bc988e2858be5 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width