mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
`$foo` variables could be assigned non-compile time values. `$foo[0] = ...` was incorrectly requiring that the assigned values were compile time constants.
21 lines
301 B
Plaintext
21 lines
301 B
Plaintext
fn void test1()
|
|
{
|
|
int a;
|
|
var $x;
|
|
$x = a; // #error: only assign constants to a compile time
|
|
}
|
|
fn void test2()
|
|
{
|
|
int a;
|
|
int[2] $x = { 1, 2 };
|
|
$x[0] = a; // #error: argument must be a constant value
|
|
}
|
|
|
|
int g;
|
|
fn void test3()
|
|
{
|
|
int*[2] $x = { &g + 1, null };
|
|
int* $y = &g + 1;
|
|
$x[0] = &g + 1;
|
|
}
|