Skip to content

instanceof on union type incorrectly issues error #1785

Closed
@epic0tix

Description

@epic0tix

The below statement does not work as it wants the left side of the instanceof statement to be of type any, which kind of defeats the purpose as once you do that TS will not longer use typegaurds, or am I missing something

constructor(template: string|templateMap){

           if (template instanceof templateMap) {
                con = super.getPaneContainer(template.selector);
            } else {
                con = super.getPaneContainer('.ui-layout-center');
            }

}

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptFixedA PR has been merged for this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions