# Sema: allow mixing array and vector operands · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/b6ccde47adeb0dbd7b39150c36498100e0d98075)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: b6ccde47adeb0dbd7b39150c36498100e0d98075

Requested commit: b6ccde47adeb0dbd7b39150c36498100e0d98075

Commit: b6ccde47adeb0dbd7b39150c36498100e0d98075

Tree: c9fff157c08701cd6d6849a1c95fddd5385e1c86

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
Sema: allow mixing array and vector operands

 * Added peer type resolution for arrays and vectors: the vector type is
   selected.
 * Fixed passing the lhs type or rhs type instead of the peer resolved
   type when calling Value methods during analyzeArithmetic handling of
   comptime expressions.
 * `checkVectorizableBinaryOperands` now allows mixing vectors and
   arrays, as long as one of the operands is a vector.

This matches stage1's handling of `^=` but apparently stage1 is
inconsistent and does not handle e.g. `*=`. stage2 now will always allow
mixing vector and array operands for all operations.

```

## Parents

- [691c7cb3cd3cc6cb4f6324d0ad4a5c3e2e8ff94c](https://git.cafe/gitcafe/zig/commit/691c7cb3cd3cc6cb4f6324d0ad4a5c3e2e8ff94c?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/b6ccde47adeb0dbd7b39150c36498100e0d98075?format=markdown)
