{"action":"created","issue":{"url":"https://api.github.com/repos/google/closure-compiler/issues/2696","repository_url":"https://api.github.com/repos/google/closure-compiler","labels_url":"https://api.github.com/repos/google/closure-compiler/issues/2696/labels{/name}","comments_url":"https://api.github.com/repos/google/closure-compiler/issues/2696/comments","events_url":"https://api.github.com/repos/google/closure-compiler/issues/2696/events","html_url":"https://github.com/google/closure-compiler/issues/2696","id":269589059,"number":2696,"title":"Can not extend protected method from a class defined in a function","user":{"login":"gberaudo","id":7294662,"avatar_url":"https://avatars3.githubusercontent.com/u/7294662?v=4","gravatar_id":"","url":"https://api.github.com/users/gberaudo","html_url":"https://github.com/gberaudo","followers_url":"https://api.github.com/users/gberaudo/followers","following_url":"https://api.github.com/users/gberaudo/following{/other_user}","gists_url":"https://api.github.com/users/gberaudo/gists{/gist_id}","starred_url":"https://api.github.com/users/gberaudo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gberaudo/subscriptions","organizations_url":"https://api.github.com/users/gberaudo/orgs","repos_url":"https://api.github.com/users/gberaudo/repos","events_url":"https://api.github.com/users/gberaudo/events{/privacy}","received_events_url":"https://api.github.com/users/gberaudo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-10-30T12:55:01Z","updated_at":"2017-10-30T14:12:53Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"The following case causes a compiler error:\r\n```js\r\n// parent.js \r\ngoog.provide('Parent');\r\nParent = class {\r\n  /** @protected */\r\n  method() { }\r\n};\r\n```\r\n\r\n```js\r\n// wrapper.js \r\ngoog.provide('Wrapper');\r\ngoog.require('Parent');\r\n/**\r\n * @constructor\r\n */\r\nWrapper = function() {\r\n  var Child = class extends Parent {\r\n    /** @override */\r\n    method() {\r\n      super.method();\r\n    }\r\n  };\r\n  new Child();\r\n};\r\nnew Wrapper();\r\n```\r\n\r\n```bash\r\n# Compilation\r\njava -jar compiler.jar --entry_point=Wrapper --js *.js --jscomp_error \"*\"\r\n```\r\n\r\nThe issue only occurs when the Child class is defined inside the Wrapper constructor.\r\nThe build passes when moving the definition to the top level (and adding a goog.provide).\r\n\r\nTested with google-closure-compiler `20171023.0.1`."},"comment":{"url":"https://api.github.com/repos/google/closure-compiler/issues/comments/340456060","html_url":"https://github.com/google/closure-compiler/issues/2696#issuecomment-340456060","issue_url":"https://api.github.com/repos/google/closure-compiler/issues/2696","id":340456060,"user":{"login":"gberaudo","id":7294662,"avatar_url":"https://avatars3.githubusercontent.com/u/7294662?v=4","gravatar_id":"","url":"https://api.github.com/users/gberaudo","html_url":"https://github.com/gberaudo","followers_url":"https://api.github.com/users/gberaudo/followers","following_url":"https://api.github.com/users/gberaudo/following{/other_user}","gists_url":"https://api.github.com/users/gberaudo/gists{/gist_id}","starred_url":"https://api.github.com/users/gberaudo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gberaudo/subscriptions","organizations_url":"https://api.github.com/users/gberaudo/orgs","repos_url":"https://api.github.com/users/gberaudo/repos","events_url":"https://api.github.com/users/gberaudo/events{/privacy}","received_events_url":"https://api.github.com/users/gberaudo/received_events","type":"User","site_admin":false},"created_at":"2017-10-30T14:12:53Z","updated_at":"2017-10-30T14:12:53Z","author_association":"CONTRIBUTOR","body":"You are right @ChadKillingsworth, it passes when using NTI.\r\n\r\nIt is unfortunately not an option since with NTI [in compatibility mode](https://github.com/google/closure-compiler/wiki/Using-NTI-%28new-type-inference%29) I immediately get a first round of 5000 errors. :("}}
{"actor":{"display_login":"gberaudo"}}