E3003

E3003 — Type mismatch in function argument

What the compiler reports

Error[E3003]{{.*}}'File::open'. Expected OpenMode, got i32

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
//
// File::open accepts named modes, not raw integer values.
import std::fs;

fn main() -> i32 {
  unsafe { let _file = File::open("unused", 3); }
  return 0;
}

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

Related