Skip to content

Salsa type inference should find or types #6663

Closed
@egamma

Description

@egamma

From @alexandrudima on January 27, 2016 10:49

Testing #2218

function a1() {
    return 5;
}

function a2() {
    if (1) {
        return 5;
    } else {
        return '5';
    }
}

Hovering over a1() shows its return type is number. Hovering over a2() shows its return type is any. IMHO it should show number|string -- maybe this inference code was written before or types were introduced?

Copied from original issue: microsoft/vscode#2431

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