Skip to content

Non-accessible unique symbol property included in completion list #25024

@strax

Description

@strax

TypeScript Version: 2.9.2, 3.0.0-dev.20180616

Search Terms:
Completion list, unique symbol, private symbol

Code

namespace A {
  const sym = Symbol()
  export interface Foo {
    [sym]: number
  }
}

declare const foo: A.Foo
foo.

Expected behavior:

Completion items on foo. should not include sym as the symbol is not visible outside the A namespace.

The example above uses a namespace, but the same issue is present when importing an interface with a module-private symbol from another module.

Actual behavior:

sym is included in completion items and resolving to its own declaration instead of the property type:

screen shot 2018-06-16 at 23 43 13

Playground Link:

Related Issues:

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDomain: LS: Completion ListsThe issue relates to showing completion lists in an editorFixedA PR has been merged for this issue

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions