type TestSum = int | string

struct Abc {
	s TestSum
	t TestSum
}

fn get_value[T](obj T) string {
	$for field in T.fields {
		field_value := obj.$(field.name)
		$if field_value is $sumtype {
			$for field_variant in field_value.variants {
				if field_value is field_variant {
					dump(field_value)
					$if field_value is $int {
						dump('${field_value} is an int')
					} $else $if field_value is $string {
						dump('${field_value} is a string')
					}
				}
			}
		}
	}
	return 'done'
}

fn main() {
	a := Abc{
		s: TestSum('foo')
		t: TestSum(1)
	}
	v := get_value(a)
	dump(v)
}
