HaxeFoundation / HaxeFoundation/haxe
[analyzer] dead assignment is kept due to earlier usage
Open
feature-analyzer
- Dominant language
- Haxe
- Stars
- 6.9k
- Forks
- 715
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 11
Description
Came across some curious behavior of the analyzer's dead code removal - with `-D analyzer-optimize`, `bar = ""` is removed as expected in this case:
```haxe
class Main {
public static function main() {}
function foo(bar:String) {
// trace(bar);
bar = "";
}
}
```
However, once the trace is commented in, it's kept, even though it's before the assignment.
Mostly I was wondering if `bar = ""` could be marked as unused by diagnostics, but the analyzer catching it is a prerequisite I guess. ;)
Contributor guide
Assessment
This issue has not been assessed yet.