Title: Unable to infer type to extend protected function for mixins · Issue #13924 · microsoft/TypeScript · GitHub
Open Graph Title: Unable to infer type to extend protected function for mixins · Issue #13924 · microsoft/TypeScript
X Title: Unable to infer type to extend protected function for mixins · Issue #13924 · microsoft/TypeScript
Description: TypeScript Version: RC (2.2.0) Code class Person { constructor(public name: string) {} protected myProtectedFunction() { // do something } } type Constructor Open Graph Description: TypeScript Version: RC (2.2.0) Code class Person { constructor(public name: string) {} protected myProtectedFunction() { // do something } } type Constructor X Description: TypeScript Version: RC (2.2.0) Code class Person { constructor(public name: string) {} protected myProtectedFunction() { // do something } } type Constructor<T> = new(...args: any[]) => T;...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/13924
X: @github
Domain: github.com
Links:
Viewport: width=device-width
Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Unable to infer type to extend protected function for mixins","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**TypeScript Version:** RC (2.2.0)\r\n\r\n**Code**\r\n\r\n```ts\r\nclass Person {\r\n\tconstructor(public name: string) {}\r\n\r\n\tprotected myProtectedFunction() {\r\n\t\t// do something\r\n\t}\r\n}\r\n\r\ntype Constructor\u003cT> = new(...args: any[]) => T;\r\n\r\nfunction PersonMixin\u003cT extends Constructor\u003cPerson>>(Base: T) {\r\n\treturn class extends Base {\r\n\t\tconstructor(...args: any[]) {\r\n\t\t\tsuper(...args);\r\n\t\t}\r\n\r\n\t\tmyProtectedFunction() {\r\n\t\t\tsuper.myProtectedFunction();\r\n\t\t\t// do more things\r\n\t\t}\r\n\t};\r\n}\r\n\r\nclass Customer extends PersonMixin(Person) {\r\n\taccountBalance: number;\r\n}\r\n```\r\n\r\n**Expected behavior:**\r\n\r\nNo compilation errors\r\n\r\n**Actual behavior:**\r\n\r\nErrors with: \r\n\r\n`src/test.ts|24 col 7 error| Class 'Customer' incorrectly extends base class 'PersonMixin\u003ctypeof Person>.(Anonymous class) & Person'. Type 'Customer' is not assignable to type 'Person'. Property 'myProtectedFunction' is protected but type 'Customer' is not a class derived from 'Person'.`\r\n","author":{"url":"https://github.com/agubler","@type":"Person","name":"agubler"},"datePublished":"2017-02-07T11:05:01Z","url":"https://github.com/microsoft/TypeScript/issues/13924"}
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:8a740618-4628-1024-bde2-65c692b38003 current-catalog-service-hash 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 request-id 8FC8:3F8AB1:B95DA2:EF3F8E:6B00E8CC html-safe-nonce aeac89d72b04426a34cad71ab816a8f30866efda1f590fa51c9e3841ccf3c224 visitor-payload eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RkM4OjNGOEFCMTpCOTVEQTI6RUYzRjhFOjZCMDBFOENDIiwidmlzaXRvcl9pZCI6IjI3MzE1MzEwMzY2MjUyNjY4OTIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== visitor-hmac d9c310ca4baf8f40c144ca6c10a3811d7308b6ee15ac161d4b0f49bfbd44b1d0 hovercard-subject-tag issue:205854737 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/13924/issue_layout twitter:image https://opengraph.githubassets.com/9efdbf4558c80c52e0282810241db73c8d6711899b04dffe47e4af85cf2a3a52/microsoft/TypeScript/issues/13924 twitter:card summary_large_image og:image https://opengraph.githubassets.com/9efdbf4558c80c52e0282810241db73c8d6711899b04dffe47e4af85cf2a3a52/microsoft/TypeScript/issues/13924 og:image:alt TypeScript Version: RC (2.2.0) Code class Person { constructor(public name: string) {} protected myProtectedFunction() { // do something } } type Constructor og:image:width 1200 og:image:height 600 og:site_name GitHub og:type object og:author:username agubler hostname github.com expected-hostname github.com None 27088b6977484d0d3321d9a11c907c6d6637b315cfa359ef7952dbf6292f9b14 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 624179fb8b88d26ba5bba08894eb60a1c5a1d93d ui-target full theme-color #1e2327 color-scheme light dark react-app-name issues
URLs of crawlers that visited me.