microsoft / microsoft/TypeScript
Control flow analysis gets confused by decorators
Open
@rbuckton is already working on this.
Since Feb 22, 2024.
Needs Investigation
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.3k
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 117
Description
🔎 Search Terms
decorators super control flow
🕗 Version & Regression Information
- This is the behavior in every version I tried
⏯ Playground Link
💻 Code
new class A extends class { a() {} } {
constructor() {
super();
let after;
class B {
@(after = super.a, (_1, _2) => {}) f = "";
}
after();
}
}
🙁 Actual behavior
TS complains that:
- I'm accessing
super.abefore callingsuper() - I'm calling
afterbefore initializing it
🙂 Expected behavior
That code should be fine
Additional information about the issue
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.