fn cast_test() {
	a := int(1)
	assert a == 1
	b := u64(2)
	assert b == 2
}

fn if_test() {
	mut a := 1
	if a == 1 {
		println('a == 1')
		b := 2
		if b == 2 {
			println('b == 2')
		}
		// if b != 2 {
		// println('b != 2')
		//}
	}
	if a == 2 {
		println('a == 2')
	}
	a++
	if a == 2 {
		println('now a == 2')
	}
}

fn loop() {
	mut i := 0
	for i < 5 {
		println('hello')
		i++
	}
}

fn foo(a int) {
	println('foo:')
	if a == 1 {
		println('a == 1')
	}
	if a == 7 {
		println('a == 7')
	}
	/*
	// native gen doesnt support more than one variable
	mut b := a + 1
	if b == 2 {
		println('b == 2')
	}
	if b == 3 {
		println('b == 3')
	}
	if b == 8 {
		println('b == 8')
	}
	*/
}

fn args() {
	x := 7
	println('===args===')
	foo(1) // prints 1 2
	foo(x) // prints 7 8
	foo(2) // prints 3
}

/*
fn expr() {
	println('===expr===')
	a := 1
	b := 2
	c := a + b
	println('c==')
	if c == 0 {
		println('0')
	}
	if c == 3 {
		println('3')
	}
}
*/

struct User {
	age       int
	nr_orders int
}

fn main() {
	if_test()
	cast_test()
	loop()
	args()
	// expr()
}
