Skip to content

Consider contextually typing class member functions by their base class/interface members #1373

Closed
@kns98

Description

here is my code

    export enum SortDir
    {
        Asc,
        Desc,
        Flip
    }

    export interface ISortInfo
    {
        getvalue(x: QuerySummary): any; //change to number|string in TypeScript 1.4
        order: SortDir;
        ordercalc?: number;
    }

    class SortByQueryId implements ISortInfo
    {
        getvalue = x => x.QueryId;
        order = SortDir.Flip;
    }

when I type "x." I expect to see the properties of QuerySummary but I do not. VS still thinks the type is 'any'

Metadata

Assignees

Labels

Design LimitationConstraints of the existing architecture prevent this from being fixedSuggestionAn idea for TypeScriptWon't FixThe severity and priority of this issue do not warrant the time or complexity needed to fix it

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions