-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Closed
Labels
RevisitAn issue worth coming back toAn issue worth coming back toSuggestionAn idea for TypeScriptAn idea for TypeScript
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?
thorn0, Arrow7000, vinz243, marvinscharle, StephaneTrebel and 81 more
Metadata
Metadata
Assignees
Labels
RevisitAn issue worth coming back toAn issue worth coming back toSuggestionAn idea for TypeScriptAn idea for TypeScript