JoshuaKGoldberg / JoshuaKGoldberg/TypeStat
🐛 Bug: Using missingProperties with private class properties broken
- Dominant language
- TypeScript
- Stars
- 2.3k
- Forks
- 47
- Avg merge
- 15h 55m
- Merged PRs (30d)
- 21
Description
### Bug Report Checklist
- [x] I have tried restarting my IDE and the issue persists.
- [x] I have pulled the latest `main` branch of the repository.
- [x] I have [searched for related issues](https://github.com/JoshuaKGoldberg/TypeStat/issues?q=is%3Aissue) and found none that matched my issue.
### Expected
```ts
class WaveTracker {
#previouslySeen = new Set();
#repeatedCount = 0;
addAndCheck() {
this.#repeatedCount = 0;
}
}
```
or
```ts
class WaveTracker {
#previouslySeen = new Set();
#repeatedCount: number = 0;
addAndCheck() {
this.#repeatedCount = 0;
}
}
```
### Actual
```ts
class WaveTracker {
#previouslySeen = new Set();
#repeatedCount = 0;
#repeatedCount: number;
#repeatedCount: number;
#repeatedCount: number;
#repeatedCount: number;
#repeatedCount: number;
#repeatedCount: number;
#repeatedCount: number;
#repeatedCount: number;
#repeatedCount: number;
#repeatedCount: number;
#repeatedCount: number;
#repeatedCount: number;
#repeatedCount: number;
#repeatedCount: number;
#repeatedCount: number;
#repeatedCount: number;
#repeatedCount: number;
#repeatedCount: number;
#repeatedCount: number;
addAndCheck() {
this.#repeatedCount = 0;
}
}
```
### Additional Info
This can be reproduced by adding below code to `missingPropertyAccess` test.
```ts
class WaveTracker {
#previouslySeen = new Set();
#repeatedCount = 0;
addAndCheck() {
this.#repeatedCount = 0;
}
}
```
Contributor guide
Assessment
This issue has not been assessed yet.