Skip to content

Object literal completions in declaration initializer include declared variable #41731

Closed
@andrewbranch

Description

@andrewbranch

TypeScript Version: 4.1.2

Search Terms: object literal completions

Code

const obj = { prop: o/**/ };

Expected behavior: No completion for obj, because that would be a used-before-declared error

Actual behavior: Completion for obj offered

Playground Link: https://www.typescriptlang.org/play?#code/MYewdgzgLgBCBGArGBeGBvGAHATiLAXHDAL4DcQA

Related Issues: #41539

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDomain: Completion ListsThe issue relates to showing completion lists in an editorEffort: ModerateRequires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".Help WantedYou can do this

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions