Title: Unreachable 'for' clause doesn't correctly narrow · Issue #11821 · microsoft/TypeScript · GitHub
Open Graph Title: Unreachable 'for' clause doesn't correctly narrow · Issue #11821 · microsoft/TypeScript
X Title: Unreachable 'for' clause doesn't correctly narrow · Issue #11821 · microsoft/TypeScript
Description: nightly build Oct 24, 2016 // works as expected function shouldNodeBeConsidered(ruleKey: string, node: ts.Node): boolean { for (let current: ts.Node | undefined = node; current !== undefined; current = current.parent) { // works } } // w...
Open Graph Description: nightly build Oct 24, 2016 // works as expected function shouldNodeBeConsidered(ruleKey: string, node: ts.Node): boolean { for (let current: ts.Node | undefined = node; current !== undefined; curre...
X Description: nightly build Oct 24, 2016 // works as expected function shouldNodeBeConsidered(ruleKey: string, node: ts.Node): boolean { for (let current: ts.Node | undefined = node; current !== undefined; curre...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/11821
X: @github
Domain: github.com
IPv4 address: 140.82.113.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Unreachable 'for' clause doesn't correctly narrow","articleBody":"nightly build Oct 24, 2016\n\n``` typescript\n// works as expected\nfunction shouldNodeBeConsidered(ruleKey: string, node: ts.Node): boolean {\n for (let current: ts.Node | undefined = node; current !== undefined; current = current.parent) { // works\n }\n}\n```\n\n``` typescript\n// weirdly doesn't work\nfunction shouldNodeBeConsidered(ruleKey: string, node: ts.Node): boolean {\n for (\n let current: ts.Node | undefined = node;\n current !== undefined;\n current = current.parent // \u003c-- [ts] Object is possibly 'undefined'.\n // let current: ts.Node | undefined\n\n ) {\n if (shouldImmediateNodeBeConsidered(ruleKey, current)) {\n return true;\n } else {\n continue;\n }\n }\n return false;\n}\n```\n","author":{"url":"https://github.com/zpdDG4gta8XKpMCd","@type":"Person","name":"zpdDG4gta8XKpMCd"},"datePublished":"2016-10-24T20:18:16Z","url":"https://github.com/microsoft/TypeScript/issues/11821"}
| 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:9024b734-f5b5-14f6-1a98-ede776ecfec2 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B442:D0CA2:255479D:3126342:6B0555E4 |
| html-safe-nonce | c6054bbdc558bdedf20942087aebd9a60185b81895b846f8e7580230353bdb3e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNDQyOkQwQ0EyOjI1NTQ3OUQ6MzEyNjM0Mjo2QjA1NTVFNCIsInZpc2l0b3JfaWQiOiIyNTc3MDQ2OTU1NjgzNTY3MDc3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 395981459a6d568ae2b3900777f155b085b3c09b0693eecaf83a0ee52f60d57b |
| hovercard-subject-tag | issue:184943702 |
| 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/11821/issue_layout |
| twitter:image | https://opengraph.githubassets.com/52afa5499939a631c60786e6ce985636c79057f3cd6ad76944c2f412267b79b6/microsoft/TypeScript/issues/11821 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/52afa5499939a631c60786e6ce985636c79057f3cd6ad76944c2f412267b79b6/microsoft/TypeScript/issues/11821 |
| og:image:alt | nightly build Oct 24, 2016 // works as expected function shouldNodeBeConsidered(ruleKey: string, node: ts.Node): boolean { for (let current: ts.Node | undefined = node; current !== undefined; curre... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | zpdDG4gta8XKpMCd |
| hostname | github.com |
| expected-hostname | github.com |
| None | a79a02b7e7546ea306864e922ed2103ef4c04fac63168e11c2b2d4d816793080 |
| 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 | 10dff83edfd4f3617a7792a152d44991587b434c |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width