public class Foo : Object {
	public int bar;

	[Semantics(overloads = "+")]
	public Foo add(Foo foo2) {
		var result = new Foo();
		result.bar = this.bar + foo2.bar;
		return result;
	}

	[Semantics(overloads = "-")]
	public Foo sub(Foo foo2) {
		var result = new Foo();
		result.bar = this.bar - foo2.bar;
		return result;
	}

	[Semantics(overloads = "*")]
	public Foo mult(Foo foo2) {
		var result = new Foo();
		result.bar = this.bar * foo2.bar;
		return result;
	}

	[Semantics(overloads = "/")]
	public Foo div(Foo foo2) {
		var result = new Foo();
		result.bar = this.bar / foo2.bar;
		return result;
	}
}

void main() {
	var foo1 = new Foo();
	foo1.bar = 6;
	var foo2 = new Foo();
	foo2.bar = 3;
	assert((foo1 + foo2).bar == 9);
	assert((foo1 - foo2).bar == 3);
	assert((foo1 * foo2).bar == 18);
	assert((foo1 / foo2).bar == 2);
}
