cat > bug.d << CODE
void test()
{
__vector(float[4]) f4;
__vector(uint[4]) u4;
__vector(void[16]) v16;
f4 = cast(typeof(f4)) u4; // OK
f4 = u4; // should fail
v16 = f4; // OK
f4 = v16; // should fail
f4 = cast(typeof(f4)) v16; // OK
}
CODE
dmd -c bug
It's somewhat broken that vectors of different types can be assigned without any casting. This is OK for implicit conversions to void16 vectors, but not for conversions from void16.
Comment #1 by bitter.taste — 2018-03-18T16:27:18Z
The specification states the following about the implicit conversion between vectors
> Vector types of the same size can be implicitly converted among each other.
Comment #2 by robert.schadek — 2024-12-13T18:54:06Z