{"action":"created","issue":{"url":"https://api.github.com/repos/google/closure-compiler/issues/2106","repository_url":"https://api.github.com/repos/google/closure-compiler","labels_url":"https://api.github.com/repos/google/closure-compiler/issues/2106/labels{/name}","comments_url":"https://api.github.com/repos/google/closure-compiler/issues/2106/comments","events_url":"https://api.github.com/repos/google/closure-compiler/issues/2106/events","html_url":"https://github.com/google/closure-compiler/issues/2106","id":185466928,"number":2106,"title":"Support expression in extends clauses","user":{"login":"justinfagnani","id":522948,"avatar_url":"https://avatars.githubusercontent.com/u/522948?v=3","gravatar_id":"","url":"https://api.github.com/users/justinfagnani","html_url":"https://github.com/justinfagnani","followers_url":"https://api.github.com/users/justinfagnani/followers","following_url":"https://api.github.com/users/justinfagnani/following{/other_user}","gists_url":"https://api.github.com/users/justinfagnani/gists{/gist_id}","starred_url":"https://api.github.com/users/justinfagnani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/justinfagnani/subscriptions","organizations_url":"https://api.github.com/users/justinfagnani/orgs","repos_url":"https://api.github.com/users/justinfagnani/repos","events_url":"https://api.github.com/users/justinfagnani/events{/privacy}","received_events_url":"https://api.github.com/users/justinfagnani/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2016-10-26T18:03:00Z","updated_at":"2016-10-27T17:57:14Z","closed_at":null,"body":"[Demo](https://closure-compiler.appspot.com/home#code%3D%252F%252F%2520%253D%253DClosureCompiler%253D%253D%250A%252F%252F%2520%2540compilation_level%2520ADVANCED_OPTIMIZATIONS%250A%252F%252F%2520%2540output_file_name%2520default.js%250A%252F%252F%2520%253D%253D%252FClosureCompiler%253D%253D%250A%250Afunction%2520Mixin(superclass)%2520%257B%250A%2520%2520return%2520class%2520extends%2520superclass%2520%257B%250A%2520%2520%2520%2520constructor()%2520%257B%250A%2520%2520%2520%2520%2520%2520super()%253B%250A%2520%2520%2520%2520%257D%250A%2520%2520%2520%2520%250A%2520%2520%2520%2520%252F**%2520%2540param%2520%257Bnumber%257D%2520n%2520*%252F%250A%2520%2520%2520%2520foo(n)%2520%257B%250A%2520%2520%2520%2520%2520%2520console.log(%2560foo%253A%2520%2524%257Bn%257D%2560)%253B%250A%2520%2520%2520%2520%257D%250A%2520%2520%257D%250A%257D%250A)\r\n\r\nClasses can extend arbitrary expressions, but Closure is throwing a warning on an unknown type.\r\n\r\n```javascript\r\nconst Mixin = (superclass) => class extends superclass {\r\n  // ...\r\n}\r\n```\r\n\r\nNote, the warning from the compiler service at least doesn't have a line number:\r\n\r\n```\r\nJSC_TYPE_PARSE_ERROR: Bad type annotation. Unknown type superclass at line -1 beyond character 1\r\n```"},"comment":{"url":"https://api.github.com/repos/google/closure-compiler/issues/comments/256721461","html_url":"https://github.com/google/closure-compiler/issues/2106#issuecomment-256721461","issue_url":"https://api.github.com/repos/google/closure-compiler/issues/2106","id":256721461,"user":{"login":"dimvar","id":286890,"avatar_url":"https://avatars.githubusercontent.com/u/286890?v=3","gravatar_id":"","url":"https://api.github.com/users/dimvar","html_url":"https://github.com/dimvar","followers_url":"https://api.github.com/users/dimvar/followers","following_url":"https://api.github.com/users/dimvar/following{/other_user}","gists_url":"https://api.github.com/users/dimvar/gists{/gist_id}","starred_url":"https://api.github.com/users/dimvar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dimvar/subscriptions","organizations_url":"https://api.github.com/users/dimvar/orgs","repos_url":"https://api.github.com/users/dimvar/repos","events_url":"https://api.github.com/users/dimvar/events{/privacy}","received_events_url":"https://api.github.com/users/dimvar/received_events","type":"User","site_admin":false},"created_at":"2016-10-27T17:57:14Z","updated_at":"2016-10-27T17:57:14Z","body":"A couple quick notes.\r\n\r\n1) We are not prioritizing new type-system features at the moment, while we're trying to migrate to the new type checker, and then add new features only there, not to both type checkers.\r\n\r\n2) You can use structural interfaces (with `@record`) to type a class that extends some other class and uses a mixin, eg:\r\n\r\n    /** @record */\r\n    function ExtraProps() {}\r\n    /** @type {function(number)} */\r\n    ExtraProps.prototype.bar;\r\n    \r\n    /**\r\n     * @constructor\r\n     * @extends {Base}\r\n     * @implements {Bar}\r\n     */\r\n    let MixedBase = Mixin(Base);"}}
{"actor":{"display_login":"dimvar"}}