{"action":"closed","issue":{"url":"https://api.github.com/repos/jashkenas/coffeescript/issues/4157","labels_url":"https://api.github.com/repos/jashkenas/coffeescript/issues/4157/labels{/name}","comments_url":"https://api.github.com/repos/jashkenas/coffeescript/issues/4157/comments","events_url":"https://api.github.com/repos/jashkenas/coffeescript/issues/4157/events","html_url":"https://github.com/jashkenas/coffeescript/issues/4157","id":121518342,"number":4157,"title":"parameter is undefined when using @parameter in a constructor","user":{"login":"chilversc","id":145440,"avatar_url":"https://avatars.githubusercontent.com/u/145440?v=3","gravatar_id":"","url":"https://api.github.com/users/chilversc","html_url":"https://github.com/chilversc","followers_url":"https://api.github.com/users/chilversc/followers","following_url":"https://api.github.com/users/chilversc/following{/other_user}","gists_url":"https://api.github.com/users/chilversc/gists{/gist_id}","starred_url":"https://api.github.com/users/chilversc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chilversc/subscriptions","organizations_url":"https://api.github.com/users/chilversc/orgs","repos_url":"https://api.github.com/users/chilversc/repos","events_url":"https://api.github.com/users/chilversc/events{/privacy}","received_events_url":"https://api.github.com/users/chilversc/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-12-10T15:57:49Z","updated_at":"2015-12-10T16:35:30Z","closed_at":"2015-12-10T16:35:30Z","body":"Updating some older scripts that used to work under 1.3.1 and it seems something has broken when using `@parameter` then referring to that parameter in the body of the constructor (instead of the field).\r\n\r\nThe parameter gets aliased to `@parameter1` but the references to the parameter within the constructor body are not updated.\r\n\r\n```coffee\r\nclass Test\r\n\tconstructor: (@service) ->\r\n\t\tservice.run()\r\n```\r\n\r\n```javascript\r\n// Generated by CoffeeScript 1.10.0\r\n(function() {\r\n  var Test;\r\n\r\n  Test = (function() {\r\n\tfunction Test(service1) {\r\n\t  this.service = service1;\r\n\t  service.run();\r\n\t}\r\n\r\n\treturn Test;\r\n\r\n  })();\r\n\r\n}).call(this);\r\n```\r\n\r\nIt seems coffeescript is mistaking the parameter as a variable in the outer scope. I thought that this syntax was supposed to be a shortcut for the equivalent to\r\n\r\n```coffee\r\nclass Test\r\n    constructor: (service) ->\r\n        @service = service\r\n```\r\n"}}