Title: 2.0: Type guards not working inside callbacks · Issue #7719 · microsoft/TypeScript · GitHub
Open Graph Title: 2.0: Type guards not working inside callbacks · Issue #7719 · microsoft/TypeScript
X Title: 2.0: Type guards not working inside callbacks · Issue #7719 · microsoft/TypeScript
Description: function f(x: {}) { if (typeof x === 'string') { x.charAt(0); // OK [1, 2].map(i => x.charAt(i)); // OK in 1.8, error in current master } } This appears to have started with commit dad0564
Open Graph Description: function f(x: {}) { if (typeof x === 'string') { x.charAt(0); // OK [1, 2].map(i => x.charAt(i)); // OK in 1.8, error in current master } } This appears to have started with commit dad0564
X Description: function f(x: {}) { if (typeof x === 'string') { x.charAt(0); // OK [1, 2].map(i => x.charAt(i)); // OK in 1.8, error in current master } } This appears to have started with commit dad0564
Opengraph URL: https://github.com/microsoft/TypeScript/issues/7719
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"2.0: Type guards not working inside callbacks","articleBody":"``` ts\nfunction f(x: {}) {\n if (typeof x === 'string') {\n x.charAt(0); // OK\n [1, 2].map(i => x.charAt(i)); // OK in 1.8, error in current master\n }\n}\n```\n\nThis appears to have started with commit dad05642d71408a864e80e0aad34fc43091e38ac\n","author":{"url":"https://github.com/jeffreymorlan","@type":"Person","name":"jeffreymorlan"},"datePublished":"2016-03-29T01:21:57Z","url":"https://github.com/microsoft/TypeScript/issues/7719"}
| 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:ec3e3b3a-791a-bcf6-23a4-57992af64ed6 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D022:3F8A67:C8AE16:10CD9FB:6B00FEBC |
| html-safe-nonce | d7c8ee1742b70e72102224f05815c4fe27057927d511529c9c1e07dc302877f0 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMDIyOjNGOEE2NzpDOEFFMTY6MTBDRDlGQjo2QjAwRkVCQyIsInZpc2l0b3JfaWQiOiIzOTI3MjI0MjY5NDAyMDc4OTA4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | f47326fc465d12bc69191ca26d86eb3414ae662a30d34e61fffe4f88e227e52c |
| hovercard-subject-tag | issue:144126851 |
| 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/7719/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c966bf90d5b178e4186f49a7606ced330f7d687c968116b20f882696a9b537ec/microsoft/TypeScript/issues/7719 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c966bf90d5b178e4186f49a7606ced330f7d687c968116b20f882696a9b537ec/microsoft/TypeScript/issues/7719 |
| og:image:alt | function f(x: {}) { if (typeof x === 'string') { x.charAt(0); // OK [1, 2].map(i => x.charAt(i)); // OK in 1.8, error in current master } } This appears to have started with commit dad0564 |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jeffreymorlan |
| hostname | github.com |
| expected-hostname | github.com |
| None | cb7fa109eca7d4156c889f474306b0e91336055e9adf8fd4684b61e49094d124 |
| 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 | 2b59d31a4e44f08b7af67a4b67f8fd0af3befe2a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width