8000 Contextual typing of object literal methods not working for return expressions · Issue #1610 · microsoft/TypeScript · GitHub
[go: up one dir, main page]

Skip to content
Contextual typing of object literal methods not working for return expressions #1610
@JsonFreeman

Description

@JsonFreeman
interface I {
    x(): (p: number) => void;
}

var obj: I = {
    x() {
        return q => { };
    }
}

q has type any, but should be number.

Metadata

Metadata

Assignees

No one assigned

    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

      0