3 ms·
It's not a type error. I think the error is in your definition of a function and types like that. I would've defined your types like in this example[0]. However
by funkaster 8y ago
It's not a type error. I think the error is in your definition of a function and types like that. I would've defined your types like in this example[0]. However, I don't know enough about your codebase or why you're doing this.
[0]: http://www.typescriptlang.org/play/#src=type%20NodeType%20%3D%20%22LEAF%22%20%7C%20%22AGGREGATOR%22%3B%0D%0A%0D%0Atype%20MemsqlNode%20%3D%20%7B%0D%0A%20%20host%3A%20string%3B%0D%0A%20%20port%3A%20number%3B%0D%0A%20%20type%3A%20NodeType%3B%0D%0A%7D%0D%0A%0D%0Atype%20Leaf%20%3D%20MemsqlNode%20%26%20%7B%0D%0A%20%20type%3A%20%22LEAF%22%3B%0D%0A%7D%0D%0A%0D%0Atype%20Aggregator%20%3D%20MemsqlNode%20%26%20%7B%0D%0A%20%20type%3A%20%22AGGREGATOR%22%3B%0D%0A%7D%0D%0A%0D%0Afunction%20f(leaves%3A%20Array%3CLeaf%3E%2C%20aggregators%3A%20Array%3CAggregator%3E)%3A%20Array%3CMemsqlNode%3E%20%7B%0D%0A%20%20return%20(leaves%20as%20Array%3CMemsqlNode%3E).concat(aggregators)%3B%0D%0A%7D%0D%0A http://www.typescriptlang.org/play/#src=type%20NodeType%20%3...