struct Abc {
mut:
	x int
}

fn (mut a Abc) inc_to_limit(max int) ?int {
	if a.x >= max {
		return error('x is already $max')
	}
	a.x++
	return a.x
}

fn main() {
	mut a := Abc{}
	for _ in 0 .. 4 {
		_ := a.inc_to_limit(2)
		eprintln('a: $a')
	}
}
