Closed ericzhang6222 closed 4 years ago
I see an issue lurking over here, as per my understanding, both Cat and Dog can behave as Pet during runtime as they are part of a union(both implement Pet interface {}). But essentially in the generated code the method set associated with Pet interface {} is empty, which means even a struct like type struct Empty {} can be a Pet. Please add a method to the Pet interface {} and implement the same in the structs Cat and Dog.
Fixed.
This is a simple and quick fixing as #95 is a blocker issue, now it can transfer Sysl union type too. For example, transform
to
It can be enhanced still, like adding util method to transform instance of
Pet
toCat
orDog
.