Title: Incorrect location information for `typeof` and `void` · Issue #66174 · angular/angular · GitHub
Open Graph Title: Incorrect location information for `typeof` and `void` · Issue #66174 · angular/angular
X Title: Incorrect location information for `typeof` and `void` · Issue #66174 · angular/angular
Description: Which @angular/* package(s) are the source of the bug? compiler Is this a regression? No Description The start locations of TypeofExpression and VoidExpression are incorrect. Please provide a link to a minimal reproduction of the bug No ...
Open Graph Description: Which @angular/* package(s) are the source of the bug? compiler Is this a regression? No Description The start locations of TypeofExpression and VoidExpression are incorrect. Please provide a link ...
X Description: Which @angular/* package(s) are the source of the bug? compiler Is this a regression? No Description The start locations of TypeofExpression and VoidExpression are incorrect. Please provide a link ...
Opengraph URL: https://github.com/angular/angular/issues/66174
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Incorrect location information for `typeof` and `void`","articleBody":"### Which @angular/* package(s) are the source of the bug?\n\ncompiler\n\n### Is this a regression?\n\nNo\n\n### Description\n\nThe start locations of `TypeofExpression` and `VoidExpression` are incorrect.\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```js\nimport {\n Lexer,\n ParseLocation,\n Parser,\n ParseSourceFile,\n ParseSourceSpan,\n} from '@angular/compiler';\n\nfunction getFakeSpan(fileName = 'test.html') {\n const file = new ParseSourceFile('', fileName);\n const location = new ParseLocation(file, 0, 0, 0);\n return new ParseSourceSpan(location, location);\n}\n\nconst parse = (text) => {\n const lexer = new Lexer();\n const parser = new Parser(lexer);\n\n return parser.parseBinding(text, getFakeSpan(), 0);\n};\n\nconsole.log(parse('typeof a').ast);\nconsole.log(parse('void a').ast);\n```\n\n```\nTypeofExpression {\n span: ParseSpan { start: 7, end: 8 },\n sourceSpan: AbsoluteSourceSpan { start: 7, end: 8 }, // \u003c-- Should start at 0, not 7\n expression: PropertyRead {\n span: ParseSpan { start: 7, end: 8 },\n sourceSpan: AbsoluteSourceSpan { start: 7, end: 8 },\n nameSpan: AbsoluteSourceSpan { start: 7, end: 8 },\n receiver: ImplicitReceiver {\n span: [ParseSpan],\n sourceSpan: [AbsoluteSourceSpan]\n },\n name: 'a'\n }\n}\nVoidExpression {\n span: ParseSpan { start: 5, end: 6 },\n sourceSpan: AbsoluteSourceSpan { start: 5, end: 6 }, // \u003c-- Should start at 0, not 5\n expression: PropertyRead {\n span: ParseSpan { start: 5, end: 6 },\n sourceSpan: AbsoluteSourceSpan { start: 5, end: 6 },\n nameSpan: AbsoluteSourceSpan { start: 5, end: 6 },\n receiver: ImplicitReceiver {\n span: [ParseSpan],\n sourceSpan: [AbsoluteSourceSpan]\n },\n name: 'a'\n }\n}\n```\n\n### Please provide the environment you discovered this bug in (run `ng version`)\n\n```true\n@angular/compiler 21.0.5\n```\n\n### Anything else?\n\n_No response_","author":{"url":"https://github.com/fisker","@type":"Person","name":"fisker"},"datePublished":"2025-12-18T16:51:52Z","url":"https://github.com/angular/angular/issues/66174"}
| 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:c0f6601e-b173-ef5a-2b0a-70af8abca8bb |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DE42:31E99C:17AFB0F:1F9A68A:6B0144B7 |
| html-safe-nonce | 44a66691c33d8209931781b077ea2fcb6a1fc5b7c1274c0c0edd8e962b83c9af |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERTQyOjMxRTk5QzoxN0FGQjBGOjFGOUE2OEE6NkIwMTQ0QjciLCJ2aXNpdG9yX2lkIjoiNjc0ODE1NTg0MzA2NzMzMTc2NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 60348979f35322580f257365f4e5a15ec5bb5e77ffc45815e5496af309ed063f |
| hovercard-subject-tag | issue:3743932252 |
| 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/66174/issue_layout |
| twitter:image | https://opengraph.githubassets.com/19968ceac4218ff6e5dfec219f4e6c4a9a4167165992ec6b6b68dc6b5879c4dc/angular/angular/issues/66174 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/19968ceac4218ff6e5dfec219f4e6c4a9a4167165992ec6b6b68dc6b5879c4dc/angular/angular/issues/66174 |
| og:image:alt | Which @angular/* package(s) are the source of the bug? compiler Is this a regression? No Description The start locations of TypeofExpression and VoidExpression are incorrect. Please provide a link ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | fisker |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| 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 | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width