Add some tests for static variables in nested blocks
Open
area:compiler
good-first-issue
kind:feature
status:help-wanted
- Dominant language
- C#
- Stars
- 451
- Forks
- 49
- Avg merge
- 13h 59m
- Merged PRs (30d)
- 6
Description
After #397, adding a variable in a block is handled by `BlockScope::AddVariable`. It handles `static` variables specifically: by passing them to the parent.
We'll need to add (and probably fix) some tests for that. For example, consider this snippet:
```c
void foo() {
{ // scope 1
static int x = 1;
}
{ // scope 2
static int x = 2;
}
}
```
Is this valid? (Perhaps.) Does this work in Cesium? Does this work correctly?
While we are at it, terminate `TODO[#410]` in the corresponding code.
Contributor guide
Assessment
This issue has not been assessed yet.