ForNeVeR / ForNeVeR/Cesium

Add some tests for static variables in nested blocks

Open
#410 2 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.