nir: Validate base types on array dereferences