Apologize for my English first.
I have a function like function func(): [string, string[]] which returns a Tuple. However, when I implement the return statement like
var test = ['text', ['foo', 'bar']];
return test;
Typescript inferred my return type as (string | string[])[] instead of [string, string[]].
Did I missed something or should I need to cast the return object as Tuple explicitly everytime like return <[string, string[]]>['text', ['foo', 'bar']]. If yes then isn't it quite annoying?
Provided the full function as follow:
function func(): [string, string[]] {
var test= ['text', ['foo', 'bar']];
return test;
}
Error:
Type '(string | string[])[]' is missing the following properties from type '[string, string[]]': 0, 1ts(2739)
