Prevent circular initializers.

This commit is contained in:
Christoffer Lerno
2021-12-22 01:03:15 +01:00
parent 1a9b8095b6
commit cf0a04977a
3 changed files with 26 additions and 1 deletions

View File

@@ -0,0 +1,3 @@
void *x = &x;
int y = 1 + y; // #error: This looks like the initialization of the variable was circular.

View File

@@ -0,0 +1,5 @@
fn void test()
{
void* x = &x;
int y = y; // #error: This looks like the initialization of the variable was circular.
}