Closed
Description
From @StrahilKazlachev on Gitter on November 12, 2015 9:04 AM
interface MyType {
x;y;z;
}
function transform(items: MyType[] | string[]) {
return items.map(val => val);
// ~~~~~~~~~~~~~~~~~~~~~ Cannot invoke an expression whose type lacks a call signature.
}
We should consider giving a more helpful error message if the type is a union, all of whose types have call signatures. Something like
Cannot invoke an expression whose type is a union with incompatible call signatures.
or hopefully something better than that