{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/15066","repository_url":"https://api.github.com/repos/Microsoft/TypeScript","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/15066/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/15066/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/15066/events","html_url":"https://github.com/Microsoft/TypeScript/issues/15066","id":220123937,"number":15066,"title":"Using mixins throws TS4093, TS4020 and TS4060 when exporting the class that extends the result of a mixin","user":{"login":"rolandjitsu","id":1479737,"avatar_url":"https://avatars3.githubusercontent.com/u/1479737?v=4","gravatar_id":"","url":"https://api.github.com/users/rolandjitsu","html_url":"https://github.com/rolandjitsu","followers_url":"https://api.github.com/users/rolandjitsu/followers","following_url":"https://api.github.com/users/rolandjitsu/following{/other_user}","gists_url":"https://api.github.com/users/rolandjitsu/gists{/gist_id}","starred_url":"https://api.github.com/users/rolandjitsu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rolandjitsu/subscriptions","organizations_url":"https://api.github.com/users/rolandjitsu/orgs","repos_url":"https://api.github.com/users/rolandjitsu/repos","events_url":"https://api.github.com/users/rolandjitsu/events{/privacy}","received_events_url":"https://api.github.com/users/rolandjitsu/received_events","type":"User","site_admin":false},"labels":[{"id":113970366,"url":"https://api.github.com/repos/Microsoft/TypeScript/labels/Bug","name":"Bug","color":"e11d21","default":false},{"id":114001888,"url":"https://api.github.com/repos/Microsoft/TypeScript/labels/Fixed","name":"Fixed","color":"bfe5bf","default":false}],"state":"closed","locked":false,"assignee":{"login":"sandersn","id":293473,"avatar_url":"https://avatars1.githubusercontent.com/u/293473?v=4","gravatar_id":"","url":"https://api.github.com/users/sandersn","html_url":"https://github.com/sandersn","followers_url":"https://api.github.com/users/sandersn/followers","following_url":"https://api.github.com/users/sandersn/following{/other_user}","gists_url":"https://api.github.com/users/sandersn/gists{/gist_id}","starred_url":"https://api.github.com/users/sandersn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sandersn/subscriptions","organizations_url":"https://api.github.com/users/sandersn/orgs","repos_url":"https://api.github.com/users/sandersn/repos","events_url":"https://api.github.com/users/sandersn/events{/privacy}","received_events_url":"https://api.github.com/users/sandersn/received_events","type":"User","site_admin":false},"assignees":[{"login":"sandersn","id":293473,"avatar_url":"https://avatars1.githubusercontent.com/u/293473?v=4","gravatar_id":"","url":"https://api.github.com/users/sandersn","html_url":"https://github.com/sandersn","followers_url":"https://api.github.com/users/sandersn/followers","following_url":"https://api.github.com/users/sandersn/following{/other_user}","gists_url":"https://api.github.com/users/sandersn/gists{/gist_id}","starred_url":"https://api.github.com/users/sandersn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sandersn/subscriptions","organizations_url":"https://api.github.com/users/sandersn/orgs","repos_url":"https://api.github.com/users/sandersn/repos","events_url":"https://api.github.com/users/sandersn/events{/privacy}","received_events_url":"https://api.github.com/users/sandersn/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/Microsoft/TypeScript/milestones/43","html_url":"https://github.com/Microsoft/TypeScript/milestone/43","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/milestones/43/labels","id":2434754,"number":43,"title":"TypeScript 2.4","description":"","creator":{"login":"mhegazy","id":8000722,"avatar_url":"https://avatars3.githubusercontent.com/u/8000722?v=4","gravatar_id":"","url":"https://api.github.com/users/mhegazy","html_url":"https://github.com/mhegazy","followers_url":"https://api.github.com/users/mhegazy/followers","following_url":"https://api.github.com/users/mhegazy/following{/other_user}","gists_url":"https://api.github.com/users/mhegazy/gists{/gist_id}","starred_url":"https://api.github.com/users/mhegazy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhegazy/subscriptions","organizations_url":"https://api.github.com/users/mhegazy/orgs","repos_url":"https://api.github.com/users/mhegazy/repos","events_url":"https://api.github.com/users/mhegazy/events{/privacy}","received_events_url":"https://api.github.com/users/mhegazy/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":154,"state":"closed","created_at":"2017-04-04T20:52:53Z","updated_at":"2017-08-31T18:24:30Z","due_on":null,"closed_at":"2017-06-12T20:58:01Z"},"comments":8,"created_at":"2017-04-07T06:35:33Z","updated_at":"2017-12-21T10:09:24Z","closed_at":"2017-05-22T22:46:39Z","author_association":"NONE","body":"<!-- BUGS: Please use this template. -->\r\n<!-- QUESTIONS: This is not a general support forum! Ask Qs at http://stackoverflow.com/questions/tagged/typescript -->\r\n<!-- SUGGESTIONS: See https://github.com/Microsoft/TypeScript-wiki/blob/master/Writing-Good-Design-Proposals.md -->\r\n\r\n**TypeScript Version:**  2.2.1\r\n\r\n**Code**\r\n\r\nI'm having some problems with using the new syntax for mixins. Consider the following example:\r\n```ts\r\nexport abstract class Item {\r\n    foo(): void {}\r\n}\r\n\r\nexport class FooItem extends Item {\r\n\tname?: string;\r\n\r\n\ttoString(): string {\r\n\t\tif (this.name) {\r\n\t\t\treturn this.name;\r\n\t\t}\r\n\t\treturn `${this.id}`;\r\n\t}\r\n}\r\n\r\n\r\nexport type Constructor<T> = new(...args: any[]) => T;\r\n\r\n// Throws an error when compiled\r\n// \"Error TS4060: Return type of exported function has or is using private name '(Anonymous class)'.\r\nexport function WithTags<T extends Constructor<FooItem>>(Base: T) {\r\n\treturn class extends Base {\r\n\t\tstatic getTags(): Promise<any> { ... }\r\n\t\ttags(): Promise<any> { ... }\r\n\t}\r\n}\r\n\r\n// Throws two errors:\r\n// At `Test`: \"Error TS4093: 'extends' clause of exported class 'Test' refers to a type whose name cannot be referenced.\"\r\n// At `WithTags`: \"Error TS4020: 'extends' clause of exported class 'Test' has or is using private name '(Anonymous class)'.\"\r\nexport class Test extends WithTags(FooItem) {}\r\n\r\nconst test = new Test();\r\n\r\nTest.getTags()\r\ntest.tags();\r\n```\r\n\r\n**Expected behavior:**\r\nIt should not throw any errors.\r\n\r\n**Actual behavior:**\r\nIt throws those three errors that are described in the code comments."},"comment":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/comments/353311759","html_url":"https://github.com/Microsoft/TypeScript/issues/15066#issuecomment-353311759","issue_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/15066","id":353311759,"user":{"login":"BBGONE","id":3954243,"avatar_url":"https://avatars2.githubusercontent.com/u/3954243?v=4","gravatar_id":"","url":"https://api.github.com/users/BBGONE","html_url":"https://github.com/BBGONE","followers_url":"https://api.github.com/users/BBGONE/followers","following_url":"https://api.github.com/users/BBGONE/following{/other_user}","gists_url":"https://api.github.com/users/BBGONE/gists{/gist_id}","starred_url":"https://api.github.com/users/BBGONE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BBGONE/subscriptions","organizations_url":"https://api.github.com/users/BBGONE/orgs","repos_url":"https://api.github.com/users/BBGONE/repos","events_url":"https://api.github.com/users/BBGONE/events{/privacy}","received_events_url":"https://api.github.com/users/BBGONE/received_events","type":"User","site_admin":false},"created_at":"2017-12-21T10:09:24Z","updated_at":"2017-12-21T10:09:24Z","author_association":"NONE","body":"I've found that typescript has intersection types Type1 & Type2. I did not noticed it before. It is perfect for mixing."}}
{"actor":{"display_login":"BBGONE"}}