Closed
Description
interface IFoo {
value: string[]|string;
}
function bar(options: IFoo) {
var val = options.value;
var result: string;
if (val instanceof Array) {
result = val.join('')
} else {
result = val;
}
}
val has one of two types strting[] or string
in 'if' condition checked instanceofArray
in else statement compiler should know that val has string type