René's URL Explorer Experiment


Title: [Regression] ReturnType<> Inference works on 3.3.3, breaks on 3.4.1, 3.5.1 · Issue #31814 · microsoft/TypeScript · GitHub

Open Graph Title: [Regression] ReturnType<> Inference works on 3.3.3, breaks on 3.4.1, 3.5.1 · Issue #31814 · microsoft/TypeScript

X Title: [Regression] ReturnType<> Inference works on 3.3.3, breaks on 3.4.1, 3.5.1 · Issue #31814 · microsoft/TypeScript

Description: TypeScript Version: 3.4.1, 3.5.1 Search Terms: regression, ReturnType, parameter, inference Code interface Mapper { (name : string, mixed : HandledInputT) : OutputT, } export type IsPipeable< FromF extends Mapper<...

Open Graph Description: TypeScript Version: 3.4.1, 3.5.1 Search Terms: regression, ReturnType, parameter, inference Code interface Mapper { (name : string, mixed : HandledInputT) : OutputT, } expor...

X Description: TypeScript Version: 3.4.1, 3.5.1 Search Terms: regression, ReturnType, parameter, inference Code interface Mapper<HandledInputT, OutputT> { (name : string, mixed : HandledInputT) : OutputT, }...

Opengraph URL: https://github.com/microsoft/TypeScript/issues/31814

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Regression] ReturnType\u003c> Inference works on 3.3.3, breaks on 3.4.1, 3.5.1","articleBody":"\u003c!-- 🚨 STOP 🚨 𝗦𝗧𝗢𝗣 🚨 𝑺𝑻𝑶𝑷 🚨\r\n\r\nHalf of all issues filed here are duplicates, answered in the FAQ, or not appropriate for the bug tracker. Even if you think you've found a *bug*, please read the FAQ first, especially the Common \"Bugs\" That Aren't Bugs section!\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 FAQ: https://github.com/Microsoft/TypeScript/wiki/FAQ\r\n\r\nPlease 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:**  3.4.1, 3.5.1\r\n\r\n\u003c!-- Search terms you tried before logging this (so others can find this issue more easily) -->\r\n**Search Terms:** regression, ReturnType, parameter, inference\r\n\r\n**Code**\r\n\r\n```ts\r\ninterface Mapper\u003cHandledInputT, OutputT> {\r\n    (name : string, mixed : HandledInputT) : OutputT,\r\n}\r\n\r\n\r\nexport type IsPipeable\u003c\r\n    FromF extends Mapper\u003cany, any>,\r\n    ToF extends Mapper\u003cany, any>\r\n> = (\r\n    ToF extends Mapper\u003cinfer HandledInputT, any> ?\r\n    (\r\n        ReturnType\u003cFromF> extends HandledInputT ?\r\n        true :\r\n        false\r\n    ) :\r\n    false\r\n);\r\n\r\nexport type AssertPipeable\u003c\r\n    FromF extends Mapper\u003cany, any>,\r\n    ToF extends Mapper\u003cany, any>\r\n> = (\r\n    IsPipeable\u003cFromF, ToF> extends true ?\r\n    ToF :\r\n    [ReturnType\u003cFromF>, \"is not pipeable\"]\r\n);\r\n\r\ndeclare function pipe\u003c\r\n    F0 extends Mapper\u003cunknown, any>,\r\n    F1 extends Mapper\u003cany, any>\r\n> (\r\n    f0 : F0,\r\n    f1 : AssertPipeable\u003cF0, F1>\r\n): void;\r\n\r\ndeclare function literal\u003cArrT extends (string | number | boolean | bigint | null | undefined)[]>(\r\n    ...arr: ArrT\r\n): (\r\n    Mapper\u003cunknown, ArrT[Extract\u003ckeyof ArrT, number>]>\r\n);\r\ndeclare const b: Mapper\u003c\"0\" | \"1\" | 0 | 1 | \"false\" | \"true\", boolean>\r\n\r\n//TS suddenly thinks the first arg is Mapper\u003cunknown, any>.\r\n//It is actually Mapper\u003cunknown, \"0\" | \"1\" | 0 | 1 | \"false\" | \"true\">.\r\npipe(\r\n    //TS knows this is Mapper\u003cunknown, \"0\" | \"1\" | 0 | 1 | \"false\" | \"true\">\r\n    literal(\"0\", \"1\", 0, 1, \"false\", \"true\"),\r\n    /*\r\n        Expected: works.\r\n        Actual:\r\n        Argument of type 'Mapper\u003c0 | \"0\" | \"1\" | 1 | \"false\" | \"true\", boolean>'\r\n        is not assignable to parameter of type '[any, \"is not pipeable\"]'.\r\n\r\n        Succeeds with 3.3.3,\r\n        Fails with 3.4.1,\r\n        Fails with 3.5.1\r\n    */\r\n    b\r\n);\r\n\r\nconst a = literal(\"0\", \"1\", 0, 1, \"false\", \"true\");\r\n//TS now knows the first arg is Mapper\u003cunknown, \"0\" | \"1\" | 0 | 1 | \"false\" | \"true\">\r\npipe(\r\n    a,\r\n    /*\r\n        This works.\r\n        `a` is literally the same type as\r\n        `literal(\"0\", \"1\", 0, 1, \"false\", \"true\")`.\r\n\r\n        Why would the first pipe() call fail,\r\n        but the second one succeed?\r\n\r\n        Succeeds with 3.3.3,\r\n        Succeeds with 3.4.1,\r\n        Succeeds with 3.5.1\r\n    */\r\n    b\r\n);\r\n```\r\n\r\n**Expected behavior:**\r\n\r\nThe below should work,\r\n\r\n```ts\r\npipe(\r\n    literal(\"0\", \"1\", 0, 1, \"false\", \"true\"),\r\n    b\r\n);\r\n```\r\n\r\n**Actual behavior:**\r\n\r\nIt used to work but does not work now.\r\n\r\n**Playground Link:** [Playground](http://www.typescriptlang.org/play/#src=interface%20Mapper%3CHandledInputT%2C%20OutputT%3E%20%7B%0D%0A%20%20%20%20(name%20%3A%20string%2C%20mixed%20%3A%20HandledInputT)%20%3A%20OutputT%2C%0D%0A%7D%0D%0A%0D%0A%0D%0Aexport%20type%20IsPipeable%3C%0D%0A%20%20%20%20FromF%20extends%20Mapper%3Cany%2C%20any%3E%2C%0D%0A%20%20%20%20ToF%20extends%20Mapper%3Cany%2C%20any%3E%0D%0A%3E%20%3D%20(%0D%0A%20%20%20%20ToF%20extends%20Mapper%3Cinfer%20HandledInputT%2C%20any%3E%20%3F%0D%0A%20%20%20%20(%0D%0A%20%20%20%20%20%20%20%20ReturnType%3CFromF%3E%20extends%20HandledInputT%20%3F%0D%0A%20%20%20%20%20%20%20%20true%20%3A%0D%0A%20%20%20%20%20%20%20%20false%0D%0A%20%20%20%20)%20%3A%0D%0A%20%20%20%20false%0D%0A)%3B%0D%0A%0D%0Aexport%20type%20AssertPipeable%3C%0D%0A%20%20%20%20FromF%20extends%20Mapper%3Cany%2C%20any%3E%2C%0D%0A%20%20%20%20ToF%20extends%20Mapper%3Cany%2C%20any%3E%0D%0A%3E%20%3D%20(%0D%0A%20%20%20%20IsPipeable%3CFromF%2C%20ToF%3E%20extends%20true%20%3F%0D%0A%20%20%20%20ToF%20%3A%0D%0A%20%20%20%20%5BReturnType%3CFromF%3E%2C%20%22is%20not%20pipeable%22%5D%0D%0A)%3B%0D%0A%0D%0Adeclare%20function%20pipe%3C%0D%0A%20%20%20%20F0%20extends%20Mapper%3Cunknown%2C%20any%3E%2C%0D%0A%20%20%20%20F1%20extends%20Mapper%3Cany%2C%20any%3E%0D%0A%3E%20(%0D%0A%20%20%20%20f0%20%3A%20F0%2C%0D%0A%20%20%20%20f1%20%3A%20AssertPipeable%3CF0%2C%20F1%3E%0D%0A)%3A%20void%3B%0D%0A%0D%0Adeclare%20function%20literal%3CArrT%20extends%20(string%20%7C%20number%20%7C%20boolean%20%7C%20bigint%20%7C%20null%20%7C%20undefined)%5B%5D%3E(%0D%0A%20%20%20%20...arr%3A%20ArrT%0D%0A)%3A%20(%0D%0A%20%20%20%20Mapper%3Cunknown%2C%20ArrT%5BExtract%3Ckeyof%20ArrT%2C%20number%3E%5D%3E%0D%0A)%3B%0D%0Adeclare%20const%20b%3A%20Mapper%3C%220%22%20%7C%20%221%22%20%7C%200%20%7C%201%20%7C%20%22false%22%20%7C%20%22true%22%2C%20boolean%3E%0D%0A%0D%0A%2F%2FTS%20suddenly%20thinks%20the%20first%20arg%20is%20Mapper%3Cunknown%2C%20any%3E.%0D%0A%2F%2FIt%20is%20actually%20Mapper%3Cunknown%2C%20%220%22%20%7C%20%221%22%20%7C%200%20%7C%201%20%7C%20%22false%22%20%7C%20%22true%22%3E.%0D%0Apipe(%0D%0A%20%20%20%20%2F%2FTS%20knows%20this%20is%20Mapper%3Cunknown%2C%20%220%22%20%7C%20%221%22%20%7C%200%20%7C%201%20%7C%20%22false%22%20%7C%20%22true%22%3E%0D%0A%20%20%20%20literal(%220%22%2C%20%221%22%2C%200%2C%201%2C%20%22false%22%2C%20%22true%22)%2C%0D%0A%20%20%20%20%2F*%0D%0A%20%20%20%20%20%20%20%20Expected%3A%20works.%0D%0A%20%20%20%20%20%20%20%20Actual%3A%0D%0A%20%20%20%20%20%20%20%20Argument%20of%20type%20'Mapper%3C0%20%7C%20%220%22%20%7C%20%221%22%20%7C%201%20%7C%20%22false%22%20%7C%20%22true%22%2C%20boolean%3E'%0D%0A%20%20%20%20%20%20%20%20is%20not%20assignable%20to%20parameter%20of%20type%20'%5Bany%2C%20%22is%20not%20pipeable%22%5D'.%0D%0A%0D%0A%20%20%20%20%20%20%20%20Succeeds%20with%203.3.3%2C%0D%0A%20%20%20%20%20%20%20%20Fails%20with%203.4.1%2C%0D%0A%20%20%20%20%20%20%20%20Fails%20with%203.5.1%0D%0A%20%20%20%20*%2F%0D%0A%20%20%20%20b%0D%0A)%3B%0D%0A%0D%0Aconst%20a%20%3D%20literal(%220%22%2C%20%221%22%2C%200%2C%201%2C%20%22false%22%2C%20%22true%22)%3B%0D%0A%2F%2FTS%20now%20knows%20the%20first%20arg%20is%20Mapper%3Cunknown%2C%20%220%22%20%7C%20%221%22%20%7C%200%20%7C%201%20%7C%20%22false%22%20%7C%20%22true%22%3E%0D%0Apipe(%0D%0A%20%20%20%20a%2C%0D%0A%20%20%20%20%2F*%0D%0A%20%20%20%20%20%20%20%20This%20works.%0D%0A%20%20%20%20%20%20%20%20%60a%60%20is%20literally%20the%20same%20type%20as%0D%0A%20%20%20%20%20%20%20%20%60literal(%220%22%2C%20%221%22%2C%200%2C%201%2C%20%22false%22%2C%20%22true%22)%60.%0D%0A%0D%0A%20%20%20%20%20%20%20%20Why%20would%20the%20first%20pipe()%20call%20fail%2C%0D%0A%20%20%20%20%20%20%20%20but%20the%20second%20one%20succeed%3F%0D%0A%0D%0A%20%20%20%20%20%20%20%20Succeeds%20with%203.3.3%2C%0D%0A%20%20%20%20%20%20%20%20Succeeds%20with%203.4.1%2C%0D%0A%20%20%20%20%20%20%20%20Succeeds%20with%203.5.1%0D%0A%20%20%20%20*%2F%0D%0A%20%20%20%20b%0D%0A)%3B)\r\n\r\n**Related Issues:**\r\n\r\nI feel like it is related to #29133 somehow. Because I have `ReturnType\u003c>` being used in a parameter again. But it's somewhat different this time in that the first argument is not an anonymous function \"literal\" I created. It's a function given by another function.\r\n","author":{"url":"https://github.com/AnyhowStep","@type":"Person","name":"AnyhowStep"},"datePublished":"2019-06-07T08:13:32Z","url":"https://github.com/microsoft/TypeScript/issues/31814"}

react-profiling0
react-import-mapreact,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-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:8df731a4-0fe9-25fc-7cd7-cb1c8978cb0b
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idAC32:1D86C4:2CC1B58:38E21DD:6B01B588
html-safe-nonce292807ef4ca074ffb34dd31ef8e444a857ee9327ebdb652745c0289bab85277b
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQzMyOjFEODZDNDoyQ0MxQjU4OjM4RTIxREQ6NkIwMUI1ODgiLCJ2aXNpdG9yX2lkIjoiMTQ5NDM0ODkxNzk4NTM1OTI0MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacd049e2d9414a869fb5c42cd58f2c4a02d50c7b6924c18a42d7392c1a37c0f18e
hovercard-subject-tagissue:453391389
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/TypeScript/31814/issue_layout
twitter:imagehttps://opengraph.githubassets.com/3c49420e71dec4d147c658626d9581c0bc5c90445a020adfda507df84eb24fc4/microsoft/TypeScript/issues/31814
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/3c49420e71dec4d147c658626d9581c0bc5c90445a020adfda507df84eb24fc4/microsoft/TypeScript/issues/31814
og:image:altTypeScript Version: 3.4.1, 3.5.1 Search Terms: regression, ReturnType, parameter, inference Code interface Mapper { (name : string, mixed : HandledInputT) : OutputT, } expor...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameAnyhowStep
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
turbo-cache-controlno-preview
go-importgithub.com/microsoft/TypeScript git https://github.com/microsoft/TypeScript.git
octolytics-dimension-user_id6154722
octolytics-dimension-user_loginmicrosoft
octolytics-dimension-repository_id20929025
octolytics-dimension-repository_nwomicrosoft/TypeScript
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id20929025
octolytics-dimension-repository_network_root_nwomicrosoft/TypeScript
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release8c77c9e8439031ad54c75a250694842892f693e1
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/microsoft/TypeScript/issues/31814#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F31814
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F31814
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=microsoft%2FTypeScript
Reloadhttps://github.com/microsoft/TypeScript/issues/31814
Reloadhttps://github.com/microsoft/TypeScript/issues/31814
Reloadhttps://github.com/microsoft/TypeScript/issues/31814
microsofthttps://github.com/microsoft
TypeScripthttps://github.com/microsoft/TypeScript
Codehttps://github.com/microsoft/TypeScript
Issues5k (5k)https://github.com/microsoft/TypeScript/issues
Pull requests312 (312)https://github.com/microsoft/TypeScript/pulls
Actionshttps://github.com/microsoft/TypeScript/actions
Projectshttps://github.com/microsoft/TypeScript/projects
Wikihttps://github.com/microsoft/TypeScript/wiki
Security and qualityhttps://github.com/microsoft/TypeScript/security
Insightshttps://github.com/microsoft/TypeScript/insights
https://github.com/microsoft/TypeScript
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/31814
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/31814
[Regression] ReturnType<> Inference works on 3.3.3, breaks on 3.4.1, 3.5.1https://github.com/microsoft/TypeScript/issues/31814#top
https://github.com/ahejlsberg
Working as IntendedThe behavior described is the intended behavior; this is not a bughttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Working%20as%20Intended%22
https://github.com/AnyhowStep
AnyhowStephttps://github.com/AnyhowStep
on Jun 7, 2019https://github.com/microsoft/TypeScript/issues/31814#issue-453391389
Playgroundhttp://www.typescriptlang.org/play/#src=interface%20Mapper%3CHandledInputT%2C%20OutputT%3E%20%7B%0D%0A%20%20%20%20(name%20%3A%20string%2C%20mixed%20%3A%20HandledInputT)%20%3A%20OutputT%2C%0D%0A%7D%0D%0A%0D%0A%0D%0Aexport%20type%20IsPipeable%3C%0D%0A%20%20%20%20FromF%20extends%20Mapper%3Cany%2C%20any%3E%2C%0D%0A%20%20%20%20ToF%20extends%20Mapper%3Cany%2C%20any%3E%0D%0A%3E%20%3D%20(%0D%0A%20%20%20%20ToF%20extends%20Mapper%3Cinfer%20HandledInputT%2C%20any%3E%20%3F%0D%0A%20%20%20%20(%0D%0A%20%20%20%20%20%20%20%20ReturnType%3CFromF%3E%20extends%20HandledInputT%20%3F%0D%0A%20%20%20%20%20%20%20%20true%20%3A%0D%0A%20%20%20%20%20%20%20%20false%0D%0A%20%20%20%20)%20%3A%0D%0A%20%20%20%20false%0D%0A)%3B%0D%0A%0D%0Aexport%20type%20AssertPipeable%3C%0D%0A%20%20%20%20FromF%20extends%20Mapper%3Cany%2C%20any%3E%2C%0D%0A%20%20%20%20ToF%20extends%20Mapper%3Cany%2C%20any%3E%0D%0A%3E%20%3D%20(%0D%0A%20%20%20%20IsPipeable%3CFromF%2C%20ToF%3E%20extends%20true%20%3F%0D%0A%20%20%20%20ToF%20%3A%0D%0A%20%20%20%20%5BReturnType%3CFromF%3E%2C%20%22is%20not%20pipeable%22%5D%0D%0A)%3B%0D%0A%0D%0Adeclare%20function%20pipe%3C%0D%0A%20%20%20%20F0%20extends%20Mapper%3Cunknown%2C%20any%3E%2C%0D%0A%20%20%20%20F1%20extends%20Mapper%3Cany%2C%20any%3E%0D%0A%3E%20(%0D%0A%20%20%20%20f0%20%3A%20F0%2C%0D%0A%20%20%20%20f1%20%3A%20AssertPipeable%3CF0%2C%20F1%3E%0D%0A)%3A%20void%3B%0D%0A%0D%0Adeclare%20function%20literal%3CArrT%20extends%20(string%20%7C%20number%20%7C%20boolean%20%7C%20bigint%20%7C%20null%20%7C%20undefined)%5B%5D%3E(%0D%0A%20%20%20%20...arr%3A%20ArrT%0D%0A)%3A%20(%0D%0A%20%20%20%20Mapper%3Cunknown%2C%20ArrT%5BExtract%3Ckeyof%20ArrT%2C%20number%3E%5D%3E%0D%0A)%3B%0D%0Adeclare%20const%20b%3A%20Mapper%3C%220%22%20%7C%20%221%22%20%7C%200%20%7C%201%20%7C%20%22false%22%20%7C%20%22true%22%2C%20boolean%3E%0D%0A%0D%0A%2F%2FTS%20suddenly%20thinks%20the%20first%20arg%20is%20Mapper%3Cunknown%2C%20any%3E.%0D%0A%2F%2FIt%20is%20actually%20Mapper%3Cunknown%2C%20%220%22%20%7C%20%221%22%20%7C%200%20%7C%201%20%7C%20%22false%22%20%7C%20%22true%22%3E.%0D%0Apipe(%0D%0A%20%20%20%20%2F%2FTS%20knows%20this%20is%20Mapper%3Cunknown%2C%20%220%22%20%7C%20%221%22%20%7C%200%20%7C%201%20%7C%20%22false%22%20%7C%20%22true%22%3E%0D%0A%20%20%20%20literal(%220%22%2C%20%221%22%2C%200%2C%201%2C%20%22false%22%2C%20%22true%22)%2C%0D%0A%20%20%20%20%2F*%0D%0A%20%20%20%20%20%20%20%20Expected%3A%20works.%0D%0A%20%20%20%20%20%20%20%20Actual%3A%0D%0A%20%20%20%20%20%20%20%20Argument%20of%20type%20'Mapper%3C0%20%7C%20%220%22%20%7C%20%221%22%20%7C%201%20%7C%20%22false%22%20%7C%20%22true%22%2C%20boolean%3E'%0D%0A%20%20%20%20%20%20%20%20is%20not%20assignable%20to%20parameter%20of%20type%20'%5Bany%2C%20%22is%20not%20pipeable%22%5D'.%0D%0A%0D%0A%20%20%20%20%20%20%20%20Succeeds%20with%203.3.3%2C%0D%0A%20%20%20%20%20%20%20%20Fails%20with%203.4.1%2C%0D%0A%20%20%20%20%20%20%20%20Fails%20with%203.5.1%0D%0A%20%20%20%20*%2F%0D%0A%20%20%20%20b%0D%0A)%3B%0D%0A%0D%0Aconst%20a%20%3D%20literal(%220%22%2C%20%221%22%2C%200%2C%201%2C%20%22false%22%2C%20%22true%22)%3B%0D%0A%2F%2FTS%20now%20knows%20the%20first%20arg%20is%20Mapper%3Cunknown%2C%20%220%22%20%7C%20%221%22%20%7C%200%20%7C%201%20%7C%20%22false%22%20%7C%20%22true%22%3E%0D%0Apipe(%0D%0A%20%20%20%20a%2C%0D%0A%20%20%20%20%2F*%0D%0A%20%20%20%20%20%20%20%20This%20works.%0D%0A%20%20%20%20%20%20%20%20%60a%60%20is%20literally%20the%20same%20type%20as%0D%0A%20%20%20%20%20%20%20%20%60literal(%220%22%2C%20%221%22%2C%200%2C%201%2C%20%22false%22%2C%20%22true%22)%60.%0D%0A%0D%0A%20%20%20%20%20%20%20%20Why%20would%20the%20first%20pipe()%20call%20fail%2C%0D%0A%20%20%20%20%20%20%20%20but%20the%20second%20one%20succeed%3F%0D%0A%0D%0A%20%20%20%20%20%20%20%20Succeeds%20with%203.3.3%2C%0D%0A%20%20%20%20%20%20%20%20Succeeds%20with%203.4.1%2C%0D%0A%20%20%20%20%20%20%20%20Succeeds%20with%203.5.1%0D%0A%20%20%20%20*%2F%0D%0A%20%20%20%20b%0D%0A)%3B
#29133https://github.com/microsoft/TypeScript/issues/29133
https://github.com/AnyhowStep
AnyhowStephttps://github.com/AnyhowStep
on Jun 7, 2019https://github.com/microsoft/TypeScript/issues/31814#issuecomment-499798687
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
on Jun 25, 2019https://github.com/microsoft/TypeScript/issues/31814#event-2436081531
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
BugA bug in TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Bug%22
on Jun 25, 2019https://github.com/microsoft/TypeScript/issues/31814#event-2436081711
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
TypeScript 3.6.0https://github.com/microsoft/TypeScript/milestone/93
on Jun 25, 2019https://github.com/microsoft/TypeScript/issues/31814#event-2436081729
https://github.com/RyanCavanaugh
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
on Jun 25, 2019https://github.com/microsoft/TypeScript/issues/31814#issuecomment-505255650
Anders Hejlsberg (@ahejlsberg)https://github.com/ahejlsberg
https://github.com/ahejlsberg
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
on Jul 1, 2019https://github.com/microsoft/TypeScript/issues/31814#issuecomment-507102793
#30215https://github.com/microsoft/TypeScript/pull/30215
#30215https://github.com/microsoft/TypeScript/pull/30215
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
Working as IntendedThe behavior described is the intended behavior; this is not a bughttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Working%20as%20Intended%22
BugA bug in TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Bug%22
on Jul 1, 2019https://github.com/microsoft/TypeScript/issues/31814#event-2449858222
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
TypeScript 3.6.0https://github.com/microsoft/TypeScript/milestone/93
on Jul 1, 2019https://github.com/microsoft/TypeScript/issues/31814#event-2449858314
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
completedhttps://github.com/microsoft/TypeScript/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Jul 2, 2019https://github.com/microsoft/TypeScript/issues/31814#event-2455075385
microsofthttps://github.com/microsoft
on Oct 21, 2025https://github.com/microsoft/TypeScript/issues/31814#event-20416695655
Sign up for freehttps://github.com/signup?return_to=https://github.com/microsoft/TypeScript/issues/31814
Sign in to commenthttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/31814
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
Working as IntendedThe behavior described is the intended behavior; this is not a bughttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Working%20as%20Intended%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.