E6006

E6006 — A Memory declaration's within: hierarchy forms a cycle (a space contains itself).

What the compiler reports

E6006

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

//
// 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
//
// A `within:` cycle in the memory hierarchy is incoherent and rejected (E6006).
//

Memory Ring0 {
  within: Memory::Ring1
}
Memory Ring1 {
  within: Memory::Ring0
}

fn main() -> i32 {
  return 0;
}

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

Related