Skip to content

Partial object return has inconsistent intellisense #37117

@Validark

Description

@Validark

TypeScript Version: 3.8.2

Search Terms:

Code

declare function partial<A extends object>(a: A): Partial<A>;
declare function object(): { x: number };

// try adding `.` before each semicolon
partial({ x: 2 });
partial(object());

Image

Expected behavior: Both should display x?

Actual behavior: Only one has x?, the other has x.

Note: They both have the question mark on the right hand side.
Also Note: It never shows x? on the playground:

Playground Link: https://www.typescriptlang.org/play/?ts=3.9.0-dev.20200227#code/CYUwxgNghgTiAEAzArgOzAFwJYHtXxwCMArACgEoAueAb3gA9rVkBbQkGeAXwG4AoUJFgIU6bHngAHWNigQAPAEF4IehhCpgAZwIlwGAHyko1RVXgAFGVjlKD-PtJiyIpOo3gAmbuUfW5pERk5ORAA

Related Issues: Couldn't find any

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptHelp WantedYou can do this

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions