1

Closed

Compiler fails due to scope confusion in properties

description

There seems to be regression in the 0.8.2 compiler due to scope confusion within get/set properties.

This will no longer compile:
public set value(value: number) {
    this._value = value;
}

public get keys(): string[] {
    return keys(this._obj);
}
In the first example, the compiler thinks the local "value" parameter is referring to the "this.value" property.

Error 1 Cannot convert '(value: number) => any' to 'number'

Similarly, in the second example, I am calling a global "keys" function that happens to have the same name as the "this.keys" property name.

Error 2 Supplied parameters do not match any signature of call target
Closed Mar 1, 2013 at 5:16 PM by RyanCavanaugh
Fixed in 0.8.3.0

comments

paulb wrote Feb 11, 2013 at 6:38 PM

Thanks for reporting this, marking as active which means we're taking a look at it.