podhmo / gos

wip
MIT License
0 stars 0 forks source link

seed, union definition #29

Closed podhmo closed 1 year ago

podhmo commented 1 year ago

e.g. I = X | Y | Z

podhmo commented 1 year ago
type I interface { I()}
func (x X) I(){}
func (y Y) I(){}
func (z Z)I(){}
podhmo commented 1 year ago

I := b.Union("I", X, Y, Z)
b.Type(b.Field("X", "*X"), b.Field("Y","*Y"), b.Field("Z", "*Z")).Constructor(b.Arg("args", "I").Variadic().BindFields("X","Y","Z").Transform(...))