Files
c3c/test/test_suite/cast/cast_struct_fails.c3
2021-11-16 17:46:44 +01:00

36 lines
340 B
C

struct Foo
{
int a;
float b;
}
struct Bar
{
int b;
float c;
}
struct Baz
{
int b;
int c;
}
struct BazTwo
{
int[2] d;
int e;
}
fn void test1()
{
Foo x;
Bar z = (Baz)(x); // #error: cast 'Foo' to 'Baz'
}
fn void test2()
{
Baz x;
BazTwo z = (BazTwo)(x); // #error: cast 'Baz' to 'BazTwo'
}