Files
c3c/test/test_suite/cast/cast_struct_fails.c3
Christoffer Lerno 37bb16cca1 Updated cast code.
2023-09-12 12:48:52 +02:00

36 lines
330 B
Plaintext

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: 'Foo' to 'Baz'
}
fn void test2()
{
Baz x;
BazTwo z = (BazTwo)(x); // #error: 'Baz' to 'BazTwo'
}