Closed
Description
openedon Jan 17, 2020
TypeScript Version: 3.8.0-beta
Search Terms:
- quick fix
- declare property
Code
For the code:
class Foo {
constructor() {
this._bar = 1;
}
}
new Foo().other = 'a';
Trigger the quick fix to declare a missing property on _bar
.
Expected behavior:
The quick fix adds a private property _bar
:
class Foo {
private _bar: number;
constructor() {
this._bar = 1;
}
}
Actual behavior:
The quick fix adds a standard public property:
class Foo {
_bar: number;
constructor() {
this._bar = 1;
}
}
Playground Link:
Related Issues:
/cc @JacksonKearl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment