Composition #37
Closed
ahmed-adly-khalil
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
type Animal struct {
Sound string
}
type Dog struct {
Animal `tstype:",extends"`
Breed string
} export interface Animal {
Sound: string;
}
export interface Dog extends Animal {
Breed: string;
} |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
the following structure would be serialized to JSON as a flat object if we use the standard library,
however in tygo we have to add
json:"animal"
to the Dog type in order to serialize it and this would result in a field representation, is there a way to tell tygo to merge the composed struct fields with the main struct?Beta Was this translation helpful? Give feedback.
All reactions