mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
36 lines
330 B
Plaintext
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'
|
|
}
|
|
|