mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
35 lines
369 B
Plaintext
35 lines
369 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;
|
|
}
|
|
|
|
func void test1()
|
|
{
|
|
Foo x;
|
|
Bar z = cast(x as Baz); // #error: Cannot cast 'Foo' to 'Baz'
|
|
}
|
|
func void test2()
|
|
{
|
|
Baz x;
|
|
BazTwo z = cast(x as BazTwo); // #error: Cannot cast 'Baz' to 'BazTwo'
|
|
}
|