Closed
Description
TypeScript Version: 1.8.4
Code
type stringType1 = "foo" | "bar";
type stringType2 = "baz" | "bar";
interface Temp1 {
getValue(name: stringType1);
}
interface Temp2 {
getValue(name: stringType2);
}
function test(t: Temp1 | Temp2) {
var z = t.getValue("bar"); // Error here
}
Expected behavior:
I was hoping everything would go fine (which is the case when I only use one interface in the function test
Actual behavior:
I get an error: "Cannot invoke an expression whose type lacks a call signature". Is this by design?