Closed
Description
TypeScript Version: 2.9.0-dev.20180515
Search Terms:
- refactor / refactoring
- generate get / getters, set / setters
Code
class Foo {
private _prop: number
}
Run the generate get and set accessors
refactoring on _prop
Expected behavior:
I think we should remove the _
from the exposed property names in this case:
class Foo {
private _prop: number;
public get prop(): number {
return this._prop;
}
public set prop(value: number) {
this._prop = value;
}
}
Actual behavior:
We tack on another _
to the field and use _prop
as the public names
class Foo {
private __prop: number;
public get _prop(): number {
return this.__prop;
}
public set _prop(value: number) {
this.__prop = value;
}
}