E3024
E3024 —.shape[i]on a tensor. It answered on any value, not only a tensor, and typed its answer as a rank-0 tensor.extent(i)is the read of a run-time extent.
No example yet
No fixture in the test suite asserts this code, so there is no program here that is known to trigger it. That is a gap in our coverage rather than a statement about the code.
Contributing one is a good first change — add a fixture under tests/ with a CHECK line naming E3024, and this page picks it up.
Related
A tour of VxThe chapter covering the rule this code enforces.
All diagnosticsEvery code the compiler can emit, grouped by stage.
E3023A shaped tensor initialized from a scalar.
let a : Tensor<f32, [128, 64]> = 1.0 allocated and filled a whole buffer from something that reads as an assignment, and the two codegen paths disagreed about it: the AST path emitted the allocation and a linalg.fill, the flat path kept the bare constant and handed an f32 to a call expecting a memref. Tensor<T, [..]>::fill(v) is the spelling. The rank-0 wrap (Tensor<f32, []> = 1.0) is a different thing and stays legal.
E3025extent(i) with an index that is not a literal below the tensor's rank. Rank is static, so the index is checked here rather than read past the descriptor at run time.