E3003

E3003 — Type mismatch in function argument

What the compiler reports

E3003{{.*}}Type mismatch in argument 1 for function 'requires_specific_topology'

The fragments the test suite holds the compiler to. An ellipsis marks text the test does not constrain; the emitted message also carries a source location.

A program that triggers it

// The subject is the topology on the tensor: an `ANE`-placed parameter given an `AMX`-placed
// argument. This file used to fail to parse before reaching it, so it tested nothing.
//
// Part of the Vx Project, under the Apache License v2.0 with LLVM Exceptions.
// See LICENSE for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//

fn requires_specific_topology(t : Tensor<f32, [ 128, 256 ], Topology::ANE>) -> void {}

fn main() -> i32 {
  let t : Tensor<f32, [ 128, 256 ], Topology::AMX> = 1.0;
  requires_specific_topology(t);
}

From tests/frontend/fail/topology/tensor_topology_mismatch.vx, which asserts this diagnostic on every commit.

Related