Title: non-null assertion not working on IndexedAccess where K is a TypeParameter · Issue #21369 · microsoft/TypeScript · GitHub
Open Graph Title: non-null assertion not working on IndexedAccess where K is a TypeParameter · Issue #21369 · microsoft/TypeScript
X Title: non-null assertion not working on IndexedAccess where K is a TypeParameter · Issue #21369 · microsoft/TypeScript
Description: TypeScript Version: 2.7.0-dev.20180123 Search Terms: indexed access, non null assertion, type parameter Code // --strictNullChecks enabled interface I { foo?: string; bar?: string; } declare function take Open Graph Description: TypeScript Version: 2.7.0-dev.20180123 Search Terms: indexed access, non null assertion, type parameter Code // --strictNullChecks enabled interface I { foo?: string; bar?: string; } declare functi...
X Description: TypeScript Version: 2.7.0-dev.20180123 Search Terms: indexed access, non null assertion, type parameter Code // --strictNullChecks enabled interface I { foo?: string; bar?: string; } declare functi...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/21369
X: @github
Domain: github.com
Links:
Viewport: width=device-width
Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"non-null assertion not working on IndexedAccess where K is a TypeParameter","articleBody":"\u003c!-- 🚨 STOP 🚨 𝗦𝗧𝗢𝗣 🚨 𝑺𝑻𝑶𝑷 🚨 -->\r\n\u003c!--\r\nHalf of all issues filed here are duplicates, answered in the FAQ, or not appropriate for the bug tracker.\r\n\r\nPlease help us by doing the following steps before logging an issue:\r\n * Search: https://github.com/Microsoft/TypeScript/search?type=Issues\r\n * Read the CONTRIBUTING guidelines: https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md\r\n * Read the FAQ: https://github.com/Microsoft/TypeScript/wiki/FAQ\r\n-->\r\n\r\n\u003c!-- If you have a QUESTION:\r\n THIS IS NOT A FORUM FOR QUESTIONS.\r\n Ask questions at http://stackoverflow.com/questions/tagged/typescript\r\n or https://gitter.im/Microsoft/TypeScript\r\n-->\r\n\r\n\u003c!-- If you have a SUGGESTION:\r\n Most suggestion reports are duplicates, please search extra hard before logging a new suggestion.\r\n See https://github.com/Microsoft/TypeScript-wiki/blob/master/Writing-Good-Design-Proposals.md\r\n-->\r\n\r\n\u003c!-- If you have a BUG:\r\n Please fill in the *entire* template below.\r\n-->\r\n\r\n\u003c!-- Please try to reproduce the issue with `typescript@next`. It may have already been fixed. -->\r\n**TypeScript Version:** 2.7.0-dev.20180123\r\n\r\n\u003c!-- Search terms you tried before logging this (so others can find this issue more easily) -->\r\n**Search Terms:** indexed access, non null assertion, type parameter\r\n\r\n**Code**\r\n\r\n```ts\r\n// --strictNullChecks enabled\r\n\r\ninterface I {\r\n foo?: string;\r\n bar?: string;\r\n}\r\n\r\ndeclare function take\u003cT>(p: T): void;\r\n\r\nfunction fails\u003cK extends keyof I>(o: I, k: K) {\r\n take\u003cstring | undefined>(o[k]); // works\r\n take\u003cstring>(o[k]!); // Argument of type 'I[K]' is not assignable to parameter of type 'string'. Type 'string | undefined' is not assignable to type 'string'. Type 'undefined' is not assignable to type 'string'.\r\n}\r\n\r\n// If the key is not generic, everything works as expected\r\nfunction works\u003cT extends I>(o: T, k: keyof I) {\r\n take\u003cstring>(o[k]!); // no error here, which should stay that way\r\n}\r\n```\r\n\r\n**Expected behavior:**\r\nNo error as this worked very well in `typescript@2.7.0-rc`\r\n\r\n**Actual behavior:**\r\nError as stated in the inline comment.\r\n\r\n**Playground Link:** \u003c!-- A link to a TypeScript Playground \"Share\" link which demonstrates this behavior --> \r\n\r\n**Related Issues:**\r\nAnother recent change to IndexedAccess inference: #21368\r\n","author":{"url":"https://github.com/ajafff","@type":"Person","name":"ajafff"},"datePublished":"2018-01-23T19:11:09Z","url":"https://github.com/microsoft/TypeScript/issues/21369"}
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:ba07ef58-7ccc-76e2-3890-3993fca1fea3 current-catalog-service-hash 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 request-id D27A:358871:E60219:1305022:6B00FEFC html-safe-nonce 3b811c5151be3419d891c9af8de53ff5003c81bc27f5e0fcad2a5f05e2c2bdd7 visitor-payload eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMjdBOjM1ODg3MTpFNjAyMTk6MTMwNTAyMjo2QjAwRkVGQyIsInZpc2l0b3JfaWQiOiI2MjI5MzY5MDkyNzMwNTg0ODI4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= visitor-hmac 8f60fa6cdccb46903d0395dce50fc504e171acb0911d4d6d24d7fd8d836866ad hovercard-subject-tag issue:290958437 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/21369/issue_layout twitter:image https://opengraph.githubassets.com/f5f818124a45ad55ece37832102338f2faf6c05fe9c611361128376d09c1620e/microsoft/TypeScript/issues/21369 twitter:card summary_large_image og:image https://opengraph.githubassets.com/f5f818124a45ad55ece37832102338f2faf6c05fe9c611361128376d09c1620e/microsoft/TypeScript/issues/21369 og:image:alt TypeScript Version: 2.7.0-dev.20180123 Search Terms: indexed access, non null assertion, type parameter Code // --strictNullChecks enabled interface I { foo?: string; bar?: string; } declare functi... og:image:width 1200 og:image:height 600 og:site_name GitHub og:type object og:author:username ajafff 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
URLs of crawlers that visited me.