Skip to content

Incorrect completion offered for export default of named function/class #16706

Closed

Description

TypeScript Version: 2.5.0-dev.20170622

Code

// a.ts
export default function foo () {}

// b.ts
import * as a from './a'

a./* request completion */

Expected behavior:
default to be offered as the completion options.

Actual behavior:
foo is offered as the completion option.

image

Fortunately, the type checker correctly expects default as the key. Calling a.default() will work, but a.foo() (as suggested by the completions) will error with "Property 'foo' does not exist on type".

Also possibly related is that import { /* request completion */ } from './a' does not list default as an option (it should), but it at least does not list foo.

Activity

  1. added
    Bug
    Domain: LS: Completion Lists
    on Jun 26, 2017
  2. ghost closed this as completedin #16742on Jul 11, 2017
  3. ghost added
    Fixed
    on Jul 11, 2017
  4. locked and limited conversation to collaborators on Jun 14, 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

    BugDomain: LS: Completion ListsFixed

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions