1.0 RC compiler bug

Topics: General
Feb 26, 2014 at 11:26 PM
Start with the "Walkthrough - Classes" sample from the playground.

Add the following to the Greeter class
    kickOut = (message: string ) => {
        var sayings : Array<string> = ['Bye', 'Adiós'];
        sayings.forEach( (value) => { console.log(value + message);});
You get a compiler error indicating that message variable from the forEach callback cannot reference the constructor's message instance. However, message is a parameter to the function that the callback is in and therefore references that instance, not the constructor variable.

"Initializer of instance member variable 'kickOut' cannot reference identifier 'message' declared in the constructor"

This was working in 0.9.5
Feb 26, 2014 at 11:29 PM
Already tracking with http://typescript.codeplex.com/workitem/2215 . Thanks!
Feb 26, 2014 at 11:41 PM
Thanks for the fast feedback. Any hope for a patch before 1.0 as this is breaking a lot of code in our 10000+ TS line project
Feb 27, 2014 at 1:08 AM
Should have a fix get checked in to the release-1.0 branch the next hour or so.