struct Aa {
	sub Bb
}

struct AaWithAliasType {
	sub Bb
}

type AliasType = Bb

struct Bb {
	a int
}

fn encode_struct[U](val U) {
	$for field in U.fields {
		_ = struct {
			...val.$(field.name)
		}
	}
}

fn main() {
	aa := Aa{}
	bb := Bb{}
	aa_with_alias_type := AaWithAliasType{}

	encode_struct(aa)
	encode_struct(aa_with_alias_type)

	encode_struct(bb)
}
