Skip to content

Show union of supported types when completing overload #19474

Closed

Description

@mjbvz

TypeScript Version: 2.7.0-dev.20171025

Code

interface Abc {
    abc: number
}

interface Xyz {
    xyz: number
}

declare function foo(x: Abc);
declare function foo(x: Xyz); 

foo({
    |
})

Trigger completions at |

Expected behavior:
Suggestions for both abc and xyz are returned since either version of overload could apply

Actual behavior:
Only a completion for abc is returned.

// cc Pine (@octref)

Activity

  1. added
    VS Code Tracked
    on Oct 25, 2017
  2. mjbvz commented on Oct 25, 2017

    @mjbvz
    ContributorAuthor

    Perhaps the more interesting case is:

    interface Abc {
        abc: number
    }
    
    interface Xyz {
        xyz: number
    }
    
    declare function foo(x: Abc);
    declare function foo(x: Xyz); 
    
    foo({
        x|
    })

    In this case, no suggestions are shown because we map the argument type to Abc

  3. added
    Suggestion
    Domain: LS: Completion Lists
    on Oct 25, 2017
  4. ghost removed this from the TypeScript 2.9 milestone on May 7, 2018
  5. ghost added this to the TypeScript 3.0 milestone on May 7, 2018
  6. added
    Fixed
    on Jul 2, 2018
  7. ghost closed this as completedin #25100on Jul 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Domain: LS: Completion ListsFixedSuggestionVS Code Tracked

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions