type MyInt = int

struct Bb {
mut:
	a int
	b struct {}

pub:
	c ?string
	d map[string]int
	e atomic int
pub mut:
	f   []f64
	zzz MyInt = 123
}

fn foo[U](val U) {
	$for field in U.fields {
		println('field: ${field.name}')

		$if field.is_pub == true {
			println(field.name + ' is pub?: ${field.is_pub}')
		}
		$if field.is_mut {
			println(field.name + ' is mut?: ${field.is_mut}')
		}
		$if field.is_struct {
			println(field.name + ' is struct?: ${field.is_struct}')
		}
		$if field.is_chan {
			println(field.name + ' is chan?: ${field.is_chan}')
		}
		$if field.is_array {
			println(field.name + ' is array?: ${field.is_array}')
		}
		$if field.is_map {
			println(field.name + ' is map?: ${field.is_map}')
		}
		$if field.is_alias {
			println(field.name + ' is alias?: ${field.is_alias}')
		}
		$if field.is_shared {
			println(field.name + ' is shared?: ${field.is_shared}')
		}
		$if field.is_option {
			println(field.name + ' is option?: ${field.is_option}')
		}
		$if field.is_atomic {
			println(field.name + ' is atomic?: ${field.is_atomic}')
		}
	}
}

fn main() {
	bb := Bb{}
	foo(bb)
}
