{"action":"closed","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/3414","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/3414/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/3414/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/3414/events","html_url":"https://github.com/Microsoft/TypeScript/issues/3414","id":86120568,"number":3414,"title":"Incorrect JS emitted for a simple case of a base/derived class in 1.5-beta","user":{"login":"ddotlic","id":1737586,"avatar_url":"https://avatars.githubusercontent.com/u/1737586?v=3","gravatar_id":"","url":"https://api.github.com/users/ddotlic","html_url":"https://github.com/ddotlic","followers_url":"https://api.github.com/users/ddotlic/followers","following_url":"https://api.github.com/users/ddotlic/following{/other_user}","gists_url":"https://api.github.com/users/ddotlic/gists{/gist_id}","starred_url":"https://api.github.com/users/ddotlic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ddotlic/subscriptions","organizations_url":"https://api.github.com/users/ddotlic/orgs","repos_url":"https://api.github.com/users/ddotlic/repos","events_url":"https://api.github.com/users/ddotlic/events{/privacy}","received_events_url":"https://api.github.com/users/ddotlic/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":16,"created_at":"2015-06-08T10:30:20Z","updated_at":"2015-06-08T20:03:32Z","closed_at":"2015-06-08T20:03:32Z","body":"I hope this is not a dupe, I was really surprised by this bug because - being so simple in nature - it appears it should have been caught by your tests (or at least stumbled upon by other people), hence there is a slight probability that I misunderstood something or that the compiler isn't capable to do the necessary work (at which point I'd be doubly disappointed).\r\n\r\nAnyway, the example is artificial because it's extracted from a larger code base.\r\n\r\nImagine a simple project, let's start with `tsconfig.json`\r\n\r\n```\r\n{\r\n    \"compilerOptions\": {\r\n        \"target\" : \"ES5\",\r\n        \"noImplicitAny\": true,\r\n        \"out\": \"badout.js\"\r\n    }\r\n}\r\n```\r\n\r\nIn the same folder, add a single file `c.ts` which is just `class C {}`\r\n\r\nAdd a subfolder called `sub` and put the following two files inside:\r\n\r\n```\r\n// file a.ts\r\nclass A extends B {\r\n    method1(p1:number, p2:string):void {}\r\n}\r\n```\r\n\r\n```\r\n// file b.ts\r\nclass B {\r\n    method1(p1:number, p2:string):void {}\r\n}\r\n```\r\n\r\nThen simply run tsc in the project folder (the one containing `tsconfig.json` and `c.ts`)\r\n\r\nThe output will be:\r\n```\r\nvar C = (function () {\r\n    function C() {\r\n    }\r\n    return C;\r\n})();\r\nvar __extends = this.__extends || function (d, b) {\r\n    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\r\n    function __() { this.constructor = d; }\r\n    __.prototype = b.prototype;\r\n    d.prototype = new __();\r\n};\r\nvar A = (function (_super) {\r\n    __extends(A, _super);\r\n    function A() {\r\n        _super.apply(this, arguments);\r\n    }\r\n    A.prototype.method1 = function (p1, p2) { };\r\n    return A;\r\n})(B);\r\nvar B = (function () {\r\n    function B() {\r\n    }\r\n    B.prototype.method1 = function (p1, p2) { };\r\n    return B;\r\n})();\r\n```\r\n\r\nThe problem is obvious - we're trying to use `B` before it is defined.\r\n\r\nIf this has been noted and fixed, please forgive the noise.\r\n\r\nIf not, please try to look into fixing this before 1.5 is \"done\"."}}