Unary operators
User-defined unary operators participate in normal overload/type resolution across classes and structs, with conversions, generics, nullable interaction where applicable, and focused diagnostics.
VOID Language operators
User-defined operators go through the same overload and conversion machinery as ordinary calls. Static interface contracts let generic code require those operations without adding a runtime generic dispatcher.
Completed operator foundation
Concrete and constrained generic operators are bound before code generation. Specialization and iterator lowering preserve that decision rather than reopening overload resolution later, and no runtime generic operator dispatcher is required.
User-defined unary operators participate in normal overload/type resolution across classes and structs, with conversions, generics, nullable interaction where applicable, and focused diagnostics.
User-defined arithmetic, comparison, equality, and relevant compound-operation paths share normal conversion ranking and overload resolution instead of separate operator-specific rules.
Interfaces can require supported static operators. Implementing types are validated through the same static-interface contract system used by other static members.
A generic method constrained by an operator-bearing interface can use that operator through T. Monomorphization resolves the operation to the concrete implementation.
When constrained generic locals are promoted into iterator state-machine fields, VOID preserves their generic origin and constraint metadata so operator legality survives suspension and resume.
User-facing diagnostics describe the language rule or invalid construct itself rather than exposing historical internal milestone labels.
Semantic ownership
Static-interface operator constraints authorize the operation in generic source. Specialization then lowers that already-valid operation to the concrete operator. Iterator and closure transformations preserve the semantic provenance instead of asking later stages to rediscover why the operation was legal.
public static IEnumerable<T> Accumulate<T>(T sum, T other)
where T : IAdd<T>
{
yield return sum;
sum += other;
yield return sum;
}public interface IAdd<T>
{
static T operator +(T left, T right);
}
public static T Add<T>(T left, T right)
where T : IAdd<T>
{
return left + right;
}public struct Int2
{
public int X;
public int Y;
public static Int2 operator +(Int2 left, Int2 right)
{
return new Int2 { X = left.X + right.X, Y = left.Y + right.Y };
}
public static Int2 operator -(Int2 value)
{
return new Int2 { X = -value.X, Y = -value.Y };
}
}