{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/6034","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/6034/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/6034/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/6034/events","html_url":"https://github.com/Microsoft/TypeScript/issues/6034","id":121535150,"number":6034,"title":"unexpected argument in new decorators function","user":{"login":"OlegDokuka","id":5380167,"avatar_url":"https://avatars.githubusercontent.com/u/5380167?v=3","gravatar_id":"","url":"https://api.github.com/users/OlegDokuka","html_url":"https://github.com/OlegDokuka","followers_url":"https://api.github.com/users/OlegDokuka/followers","following_url":"https://api.github.com/users/OlegDokuka/following{/other_user}","gists_url":"https://api.github.com/users/OlegDokuka/gists{/gist_id}","starred_url":"https://api.github.com/users/OlegDokuka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OlegDokuka/subscriptions","organizations_url":"https://api.github.com/users/OlegDokuka/orgs","repos_url":"https://api.github.com/users/OlegDokuka/repos","events_url":"https://api.github.com/users/OlegDokuka/events{/privacy}","received_events_url":"https://api.github.com/users/OlegDokuka/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-12-10T17:15:12Z","updated_at":"2015-12-11T18:09:25Z","closed_at":null,"body":"Hi guys!\r\n\r\nToday I have moved to typescript 1.7.3, and got unexpected issue in my decorator (there is some code below)\r\n\r\n```\r\nexport function inject(requestType: Class, ...genericTypes: Class[]): any {\r\n        return (prototype: any, ...properties: any[]) => {\r\n            let argsCount = properties.length;\r\n\r\n            switch (argsCount) {\r\n                case 1: {\r\n                    //some code\r\n                } break;\r\n                case 2: {\r\n                    if (typeof properties[1] === typeof 1) {\r\n                       //some code\r\n                    }\r\n                } break;\r\n            }\r\n        }\r\n    }\r\n```\r\n\r\nThis worked perfectly with TS 1.6, where decorators function looked like \r\n\r\n```\r\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\r\n    if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") return Reflect.decorate(decorators, target, key, desc);\r\n    switch (arguments.length) {\r\n        case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);\r\n        case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);\r\n        case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);\r\n    }\r\n};\r\n```\r\n\r\nand compiler for TS code\r\n```\r\nclass NoiseMakerClass {\r\n    @inject(SimpleNoiser) ownNoiser:SimpleNoiser = undefined;\r\n\r\n    doWork() {\r\n        this.ownNoiser.makeNoise();\r\n    }\r\n}\r\n```\r\ngenerate next JS code\r\n\r\n```\r\n__decorate([\r\n        inject(SimpleNoiser)\r\n    ], NoiseMakerClass.prototype, \"ownNoiser\");\r\n```\r\n\r\n***BUT*** new TS 1.7.3 generate a bit different function with new one unexpected argument\r\n\r\n```\r\n__decorate([\r\n        inject(SimpleNoiser)\r\n    ], NoiseMakerClass.prototype, \"ownNoiser\", void 0);\r\n```\r\nAlso, I have found that last 'void 0' argument added only if my `tsconfig.json` contains next code\r\n\r\n```\r\n{\r\n  \"version\": \"1.7.3\",\r\n  \"compilerOptions\": {\r\n    \"target\": \"es5\",\r\n    \"declaration\": true,\r\n    \"noImplicitAny\": false,\r\n    \"removeComments\": true,\r\n    \"noLib\": false,\r\n    \"emitDecoratorMetadata\": false,\r\n    \"sourceMap\": true,\r\n    \"listFiles\": true,\r\n    \"outDir\": \"\",\r\n    \"out\": \"Compiled/typejector.js\",\r\n    \"experimentalDecorators\": true\r\n  },\r\n  \"files\": [\r\n    \"app.ts\"\r\n  ]\r\n}\r\n```\r\n\r\nCan someone explain me why compiler add 'void 0' argument in this case?"},"comment":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/comments/164006343","html_url":"https://github.com/Microsoft/TypeScript/issues/6034#issuecomment-164006343","issue_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/6034","id":164006343,"user":{"login":"DanielRosenwasser","id":972891,"avatar_url":"https://avatars.githubusercontent.com/u/972891?v=3","gravatar_id":"","url":"https://api.github.com/users/DanielRosenwasser","html_url":"https://github.com/DanielRosenwasser","followers_url":"https://api.github.com/users/DanielRosenwasser/followers","following_url":"https://api.github.com/users/DanielRosenwasser/following{/other_user}","gists_url":"https://api.github.com/users/DanielRosenwasser/gists{/gist_id}","starred_url":"https://api.github.com/users/DanielRosenwasser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanielRosenwasser/subscriptions","organizations_url":"https://api.github.com/users/DanielRosenwasser/orgs","repos_url":"https://api.github.com/users/DanielRosenwasser/repos","events_url":"https://api.github.com/users/DanielRosenwasser/events{/privacy}","received_events_url":"https://api.github.com/users/DanielRosenwasser/received_events","type":"User","site_admin":false},"created_at":"2015-12-11T18:09:25Z","updated_at":"2015-12-11T18:09:25Z","body":"@rbuckton could you take a stab at answering the concerns here?"}}