Closed
Description
TypeScript Version: 2.7.0-dev.201xxxxx
Code
interface Foo {
x: number
}
interface Bar {
y: boolean
}
interface Baz {
(foo: Foo): void
(bar: Bar): void
}
declare const baz: Baz
declare const foobar: Foo | Bar
baz(foobar)
Expected behavior:
Should compile.
Actual behavior:
The last line has a type error,
Argument of type 'Foo | Bar' is not assignable to parameter of type 'Bar'.
Type 'Foo' is not assignable to type 'Bar'.
Property 'y' is missing in type 'Foo'.