SIMD, @splat, @reduce?

Nope! You can put any type for result, and still get the same error.

I’m not sure why you are bringing up arrays. Operations between vectors result in a vector, and they have to be the same length. Even if you use @splat, it will not fill in the rest.

Vectors do coerce to/from arrays, but that isn’t relevant to this issue.

It is also not specifically the length, but the whole result type that @splat doesn’t know.

Please try to compile and run code before answering people.

Well I guess I misread your code.

I failed to realize you wanted @splat(1) to create a new vector and add that to the previous.

const foo: @Vector(2, i16) = .{ 0, 0 };
const result = foo + @as(@Vector(2, i16), @splat(1));

you’re asking why this cannot be deduced when the only valid right hand to the + operator on foo should be a Vector(2, i16). Problem is that it doesn’t have to be a @Vector(2, i16) just any @Vector(2, X)

const foo: @Vector(2, i16) = .{ 0, 0 };
const result = foo + @as(@Vector(2, i8), @splat(1));

this is totally valid too and then we’re in the territory of explicit value ranges and fear of overflow, etc.

Perhaps I’m confused as you’re replying to me, I am not the one asking about this behaviour, I gave a more detailed version of this answer yesterday.

damn, mobile browsing… I must have hit the wrong reply button… I thought I was replying to @Luke now your confusion makes total sense.