Title: Parsing issue for call expression with type arguments following left-shift · Issue #37760 · microsoft/TypeScript · GitHub
Open Graph Title: Parsing issue for call expression with type arguments following left-shift · Issue #37760 · microsoft/TypeScript
X Title: Parsing issue for call expression with type arguments following left-shift · Issue #37760 · microsoft/TypeScript
Description: TypeScript Version: 3.8.3 Search Terms: left shift, type parameter Expected behavior: Syntax highlighting stays intact. Actual behavior: Syntax highlighting breaks, even with ts-ignore. Code function alignof
Open Graph Description: TypeScript Version: 3.8.3 Search Terms: left shift, type parameter Expected behavior: Syntax highlighting stays intact. Actual behavior: Syntax highlighting breaks, even with ts-ignore. Code functi...
X Description: TypeScript Version: 3.8.3 Search Terms: left shift, type parameter Expected behavior: Syntax highlighting stays intact. Actual behavior: Syntax highlighting breaks, even with ts-ignore. Code functi...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/37760
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Parsing issue for call expression with type arguments following left-shift","articleBody":"**TypeScript Version:** 3.8.3\r\n\r\n**Search Terms:** left shift, type parameter\r\n\r\n**Expected behavior:** Syntax highlighting stays intact.\r\n\r\n**Actual behavior:** Syntax highlighting breaks, even with ts-ignore.\r\n\r\n**Code**\r\n```ts\r\nfunction alignof\u003cT>(): number {\r\n return 1;\r\n}\r\n\r\n// works\r\nfunction foo\u003cT>(): number {\r\n return 1 >> alignof\u003cT[]>();\r\n}\r\n\r\n// breaks\r\nfunction bar\u003cT>(): number {\r\n return 1 \u003c\u003c alignof\u003cT[]>();\r\n}\r\n\r\n// still breaks, does not ignore\r\nfunction baz\u003cT>(): number {\r\n // @ts-ignore\r\n return 1 \u003c\u003c alignof\u003cT[]>();\r\n}\r\n```\r\n\r\nLooks like a rescan issue on potentially ambiguous `\u003c` tokens, attempting to interpret as `1 \u003c \u003ctype>`.\r\n\r\n**Playground Link:** [Provided](https://www.typescriptlang.org/play/index.html#code/GYVwdgxgLglg9mABAQwDYwOZjsAPAFQD4AKASgC5EwQBbAIwFMAnRAbwFgAoRRJhqEEyQBGANxcAvly4B6GYgDucJgGsAzl1CRYCRMDhwCJClVqMWHbr36CRiQoRTosOAgG0AusfGcpnWfJ0fMjqmuDQ8Eh0yExGZJTU9MxsXDx8AkKIwoi4uE6Y2Hj4nt6S0pxyiGqwqKiIQQwhagA0iAAmcAxqVHBQiAXKDGHakfXIAF5xJonmKVaVAAJQagC0A3yp1hl2ufkuRSVkPhJAA)\r\n ","author":{"url":"https://github.com/dcodeIO","@type":"Person","name":"dcodeIO"},"datePublished":"2020-04-02T18:08:33Z","url":"https://github.com/microsoft/TypeScript/issues/37760"}
| 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:0b004202-4515-8aaa-d446-08b39bf6fe92 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A192:60A6D:62D4D:82698:6B017FD0 |
| html-safe-nonce | dc3a014f1dd01e37e60b42fc600a11a636d58c2036f8bb3a2010f84cc575070c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMTkyOjYwQTZEOjYyRDREOjgyNjk4OjZCMDE3RkQwIiwidmlzaXRvcl9pZCI6Ijg2ODAxMTE1MjA5ODM2NDYxNjEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | b113c9a561d33d425a1951e689dc29740286de4b13d7f622459bd486c8d16188 |
| hovercard-subject-tag | issue:592828281 |
| 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/microsoft/TypeScript/37760/issue_layout |
| twitter:image | https://opengraph.githubassets.com/3310477c46f2534e9a934e0887a97793f996df0f6913269c4afde13e84ae3f39/microsoft/TypeScript/issues/37760 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/3310477c46f2534e9a934e0887a97793f996df0f6913269c4afde13e84ae3f39/microsoft/TypeScript/issues/37760 |
| og:image:alt | TypeScript Version: 3.8.3 Search Terms: left shift, type parameter Expected behavior: Syntax highlighting stays intact. Actual behavior: Syntax highlighting breaks, even with ts-ignore. Code functi... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dcodeIO |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoft/TypeScript git https://github.com/microsoft/TypeScript.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 20929025 |
| octolytics-dimension-repository_nwo | microsoft/TypeScript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 20929025 |
| octolytics-dimension-repository_network_root_nwo | microsoft/TypeScript |
| 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