mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 13:10:12 +03:00
16 lines
308 B
D
16 lines
308 B
D
/*
|
|
TEST_OUTPUT:
|
|
---
|
|
fail_compilation/fail304.d(15): Error: cannot cast expression `foo()` of type `Small` to `Large` because of different sizes
|
|
---
|
|
*/
|
|
|
|
struct Small { uint x; }
|
|
struct Large { uint x, y, z; }
|
|
Small foo() { return Small(); }
|
|
void main()
|
|
{
|
|
Large l;
|
|
Small s;
|
|
l = cast(Large)foo();
|
|
}
|