Open georgejecook opened 5 years ago
I probably wouldn't support the word "struct", but instead support an interface, the same way that TypeScript does. Just playing on semantics though, because I believe typescript-style interfaces are roughly what you're asking for anyway, right?
that's even better.
I updated the ticket. thanks
Similar to class, we should allow interface. this will allow us to get to a goal where the ide will have increasing information about types.
interface would produce nothing in the brs code - the benefit of the type declaration would be entirely for the ide's symbol and definition resolution and the compiler.
example
output is
the interface would simply vanish at runtime; merely providing the ide with more type info. This does of course require that we have more advanced typing, which i would dearly love to see, whereby we can have as default values (object|integer|dynamic) as well as new specific types for our classes and interface (StyleInfo|MyButton|UserInfo|FancyButton), whereby the types here are the class or node names.