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

Skip to content
Contextual typing of object literal getters not working for return expressions #1611
Closed
@JsonFreeman

Description

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

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

q has type any, but should be number.

This is related to #1610

Metadata

Metadata

Assignees

No one assigned

    Labels

    DeclinedThe issue was declined as something which matches the TypeScript visionSuggestionAn idea for TypeScriptToo ComplexAn issue which adding support for may be too complex for the value it adds

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0