Title: Design Meeting Notes, 9/27/2019 · Issue #34573 · microsoft/TypeScript · GitHub
Open Graph Title: Design Meeting Notes, 9/27/2019 · Issue #34573 · microsoft/TypeScript
X Title: Design Meeting Notes, 9/27/2019 · Issue #34573 · microsoft/TypeScript
Description: Errors for Certain Asssertions and Never-Returning Functions #33622 We now need to do control flow analysis for statement-expression level calls. But resolving the expression that's being called (i.e. f in f(x, y, z)) can kick off more c...
Open Graph Description: Errors for Certain Asssertions and Never-Returning Functions #33622 We now need to do control flow analysis for statement-expression level calls. But resolving the expression that's being called (i...
X Description: Errors for Certain Asssertions and Never-Returning Functions #33622 We now need to do control flow analysis for statement-expression level calls. But resolving the expression that's being calle...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/34573
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Design Meeting Notes, 9/27/2019","articleBody":"# Errors for Certain Asssertions and Never-Returning Functions\r\n\r\nhttps://github.com/microsoft/TypeScript/pull/33622\r\n\r\n* We now need to do control flow analysis for statement-expression level calls.\r\n* But resolving the expression that's being called (i.e. `f` in `f(x, y, z)`) can kick off more control-flow analysis.\r\n * And that can cause a loop in the control flow graph, which we can't make sense of.\r\n* Instead of erroring on the call, why not call \r\n * \\[\\[@weswigham fill this in]]\r\n* But this also forces you to add an explicit annotation for something like\r\n\r\n ```ts\r\n const tester: Tester = new Tester();\r\n ```\r\n* The alternative is that we just \"let control flow analysis do its thing\" but that causes breaks in the compiler itself.\r\n * This also means that we're hitting other issues which *don't* related\r\n* These declarations really should never be considered circularity errors but they are.\r\n * But you can't know they're \"unrelated\" until you resolve them which could cause that circularity!\r\n* Maybe you kind of want to get the type of something as if control flow had never taken effect?\r\n * Can you even do this?\r\n * Also, would it be confusing to fall back back to a different type only some of the time here?\r\n* Discuss offline.\r\n* Do we need more time to figure this out?\r\n * This seems like the minimal viable product that solves most of the use-cases.\r\n* Alternative PR which breaks existing code is not viable.\r\n* Resolution\r\n * This is technically a breaking change - document it.\r\n * This is a reasonable start - we can iterate on the implementation later.\r\n * Seed a StackOverflow question because this is confusing.\r\n\r\n# Narrowing non-declared union types\r\n\r\nhttps://github.com/microsoft/TypeScript/pull/30593\r\n\r\n* Basically the idea is that we only narrow when the type a variable is declared with (the \"declared type\") determines if we should narrow using discriminated unions.\r\n * What is desired is that once something is narrowed to a discriminatable union type, we should correctly narrow on each discrimination.\r\n* What is the crux of the change?\r\n * Currently tracks only the last union that's been encountered.\r\n * Question is whether or not adding in a stack or \"limited-depth buffer\" is appropriate.\r\n* Conclusion: Need to actually give feedback on the implementation.\r\n\r\n# Improved Template String Support in Type-Checking\r\n\r\nhttps://github.com/microsoft/TypeScript/pull/32064\r\n\r\n* Non-controversial.\r\n* Does this allow template literals for string literal types?\r\n * Not currently.\r\n* Ship it!\r\n\r\n# ts-nocheck in TS files\r\n\r\nhttps://github.com/microsoft/TypeScript/pull/33383\r\n\r\n* We support `ts-ignore` in both JS and TS files.\r\n* We support `ts-nocheck` in JS files, but not TS files!\r\n* Valuable for migration scenarios.\r\n* Do we offer suggestions to ts-ignore in TypeScript?\r\n * Yes in JS files, no in TS files.\r\n* Does this play well with declaration file emit?\r\n * The same is true of ts-ignore today.\r\n* Conclusion\r\n * 3.7-bound","author":{"url":"https://github.com/DanielRosenwasser","@type":"Person","name":"DanielRosenwasser"},"datePublished":"2019-10-18T20:37:22Z","url":"https://github.com/microsoft/TypeScript/issues/34573"}
| 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:ec3f81e1-296b-8649-ee62-71dc7b4ab89c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E036:117C62:BCE801:FD8593:6B00F85B |
| html-safe-nonce | d5299ad28d8a4a6159339a058da9be27e71d490277705579091cafcbda4f56ec |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMDM2OjExN0M2MjpCQ0U4MDE6RkQ4NTkzOjZCMDBGODVCIiwidmlzaXRvcl9pZCI6IjgxMTQ5NTcxNDk4Mjc4MjM3MDciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | a12fb6bda4dfb076c3ca95b27d36182c1dcdb37589d9388f1adefd04ef926f1f |
| hovercard-subject-tag | issue:509299187 |
| 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/34573/issue_layout |
| twitter:image | https://opengraph.githubassets.com/75ec67f99a4846f167e4e019fb18cd2d84a27995b9e33b32c8efce63200257b3/microsoft/TypeScript/issues/34573 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/75ec67f99a4846f167e4e019fb18cd2d84a27995b9e33b32c8efce63200257b3/microsoft/TypeScript/issues/34573 |
| og:image:alt | Errors for Certain Asssertions and Never-Returning Functions #33622 We now need to do control flow analysis for statement-expression level calls. But resolving the expression that's being called (i... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | DanielRosenwasser |
| hostname | github.com |
| expected-hostname | github.com |
| None | e208d86428ec00a57ade75058166297440e8128a01e5287c31a53dc042bbf187 |
| 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 | 7dafd017fb7809a839c443dba08622af38e63c09 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width