Skip to content

BC break for method call on union type #10025

Closed
@Strate

Description

@Strate

TypeScript Version: 2.1.0-dev.20160729

Code

interface A {
  focus: (force: boolean) => void
}
interface B {
  focus: () => void
}
let instance: A | B
instance.focus(true);

Expected behavior:
No compilation error at least at 2.1.0-dev.20160716

Actual behavior:
TS2349: Cannot invoke an expression whose type lacks a call signature.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Breaking ChangeWould introduce errors in existing code

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions