E2003

E2003 — Unknown enum

What the compiler reports

Error[E2003] at {{.*}}vxlib_ambiguous_import_enum.vx:23:{{[0-9]+}}: Enum 'Color' is defined in more than one imported module

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
//
// Two imported .vxlib libraries both define an enum `Color`, so `Color::Green` cannot
// pick one. The error says so, rather than calling the enum unknown.
//

import ca;
import cb;

fn main() -> i32 {
  let c = Color::Green;
  return geta() + getb();
}

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

Related