Files
c3c/test/test_suite/expressions/assignability.c3
Christoffer Lerno 8b49e6c14d Rename def to alias.
2025-03-13 11:22:27 +01:00

39 lines
573 B
Plaintext

alias Number = int;
fn void test1()
{
10 = 20; // #error: to a constant expression
}
fn void test2()
{
"foo" = "bar"; // #error: to a constant expression
}
fn void test3()
{
true = false; // #error: to a constant expression
}
fn void test4()
{
'c' = 'd'; // #error: to a constant expression
}
fn void test5()
{
3.14 = 2.14; // #error: to a constant expression
}
fn void test21()
{
int a = 0;
int b = 2;
a++ = b++; // #error: An assignable expression
}
fn void test22()
{
var $Type = void;
$Type = int;
}