Files
c3c/test/test_suite/distinct/test_ops_on_struct.c3
Christoffer Lerno 99cfaa1583 Refactor protocols.
2023-10-06 22:31:41 +02:00

24 lines
280 B
Plaintext

module test;
struct Struct
{
int x;
double y;
}
distinct Foo = Struct;
struct Struct2
{
Foo f;
int d;
}
Foo f = { 1, 1.0 };
fn void test(int x)
{
Struct s = { 1, 2.0 };
Foo f2 = (Foo)(s);
Foo f3 = { .x = 1 };
Struct2 s2 = { .f = { 1, 2.0 } };
}