Title: Incompatible code unexpectedly compiles due to intersection with empty mapped type · Issue #19869 · microsoft/TypeScript · GitHub
Open Graph Title: Incompatible code unexpectedly compiles due to intersection with empty mapped type · Issue #19869 · microsoft/TypeScript
X Title: Incompatible code unexpectedly compiles due to intersection with empty mapped type · Issue #19869 · microsoft/TypeScript
Description: TypeScript Version: Version 2.7.0-dev.20171109 Code type Args Open Graph Description: TypeScript Version: Version 2.7.0-dev.20171109 Code type Args X Description: TypeScript Version: Version 2.7.0-dev.20171109 Code type Args<S extends string, N extends string> = Record<S, string> & Record<N, number> declare function f1<S extends stri...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/19869
X: @github
Domain: github.com
Links:
Viewport: width=device-width
= Record & Record (strs: S[], nums: N[], fun: (args: Args
= Record
& Record (st...
Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Incompatible code unexpectedly compiles due to intersection with empty mapped type","articleBody":"\u003c!-- BUGS: Please use this template. -->\r\n\u003c!-- QUESTIONS: This is not a general support forum! Ask Qs at http://stackoverflow.com/questions/tagged/typescript -->\r\n\u003c!-- SUGGESTIONS: See https://github.com/Microsoft/TypeScript-wiki/blob/master/Writing-Good-Design-Proposals.md -->\r\n\r\n\u003c!-- Please try to reproduce the issue with `typescript@next`. It may have already been fixed. -->\r\n**TypeScript Version:** Version 2.7.0-dev.20171109\r\n\r\n**Code**\r\n\r\n```ts\r\ntype Args\u003cS extends string, N extends string> = Record\u003cS, string> & Record\u003cN, number>\r\n\r\ndeclare function f1\u003cS extends string, N extends string>\r\n (strs: S[], nums: N[], fun: (args: Args\u003cS, N>) => void): void\r\n\r\ndeclare function takesNum(args: {a: number}): void\r\ndeclare function takesOptionalNum(args: {a?: number}): void\r\n\r\nf1([\"a\"], [], takesNum) // *** unexpectedly compiles despite incompatibility of \"a\" ***\r\nf1([\"a\"], [\"b\"], takesNum) // Now correctly errors because of incompatibility of \"a\"\r\n\r\nf1([\"a\"], [], takesOptionalNum) // *** unexpectedly compiles despite incompatibility of \"a\" ***\r\nf1([\"a\"], [\"b\"], takesOptionalNum) // Now correctly errors because of incompatibility of \"a\"\r\n```\r\n\r\n**Expected behavior:**\r\nAll calls to `f1` should error because `takesNum` and `takesOptionalNum` expect `a` to be a number but it will actually be a string.\r\n\r\n**Actual behavior:**\r\nIt only errors if the second argument to f1 is not empty.\r\n\r\nAlso the first case shown above: `f1([\"a\"], [], takesNum)` actually errored as expected as recently as last week(I believe I was on 2.7.0-dev.20171031), it was only the optional case that unexpectedly compiled. I was about to open this for just the optional case when I checked the latest typescript version and noticed the first case started being affected also.","author":{"url":"https://github.com/kpdonn","@type":"Person","name":"kpdonn"},"datePublished":"2017-11-09T14:41:30Z","url":"https://github.com/microsoft/TypeScript/issues/19869"}
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:79df58ef-313e-eb91-44be-76839151e2c0 current-catalog-service-hash 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 request-id 8796:1DCB8C:EDC63E:13B41C6:6B010228 html-safe-nonce e3058b040e5461e9a0bba2e85dcb7e75865e11dc436a41b8cd2a5287e0038f9a visitor-payload eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4Nzk2OjFEQ0I4QzpFREM2M0U6MTNCNDFDNjo2QjAxMDIyOCIsInZpc2l0b3JfaWQiOiI3MTYyOTE1MDEwODY2MzgxMzUyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= visitor-hmac 7c8854259a08e292598a0af76972fea1184f7fc8a30f4a37286585f8074bcccd hovercard-subject-tag issue:272587784 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/19869/issue_layout twitter:image https://opengraph.githubassets.com/09ef666d643662fd17295808daf705c234d31fdc9d0c0540a21003472b41e334/microsoft/TypeScript/issues/19869 twitter:card summary_large_image og:image https://opengraph.githubassets.com/09ef666d643662fd17295808daf705c234d31fdc9d0c0540a21003472b41e334/microsoft/TypeScript/issues/19869 og:image:alt TypeScript Version: Version 2.7.0-dev.20171109 Code type Args = Record & Record (st...og:image:width 1200 og:image:height 600 og:site_name GitHub og:type object og:author:username kpdonn 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.