Ruta graveolens  ·  notes from a language experiment  ·  cultivated since 2025

E0307: Conflicting bound requirements

CodeCategoryStability
E0307SemanticPermanent

Explanation

Interfaces combined in one bound require the same member name with incompatible signatures. A bounded parameter must satisfy every requirement, and Rue does not select an overload through conformance.

Likely cause

Two combined interfaces disagree about a receiver mode, parameter, result, or member kind. Align their shared requirement or give the distinct operations distinct names.

Examples

Conflicting result types

Requires --preview interfaces.

interface Sized { fn len(borrow self) -> u64; }
interface Counted { fn len(borrow self) -> i64; }
fn measure(comptime T: Sized + Counted, borrow x: T) -> u64 { x.len() }
fn main() {}

Compatible shared requirement

Requires --preview interfaces.

interface Sized { fn len(borrow self) -> u64; }
interface Counted { fn len(borrow self) -> u64; }
fn measure(comptime T: Sized + Counted, borrow x: T) -> u64 { x.len() }
fn main() {}

References