Skip to content

Avoid listing missing properties on types with only call/construct signatures #35735

Closed
@DanielRosenwasser

Description

@DanielRosenwasser

Found with @RyanCavanaugh

interface Dog {
    barkable: true
}

declare function getRover(): Dog;

export let x: Dog = getRover;

Expected

Type '() => Dog' is not assignable to 'Dog'.(2741)
  input.ts(7, 21): Did you mean to call this expression?

Actual

Property 'barkable' is missing in type '() => Dog' but required in type 'Dog'.(2741)
  input.ts(2, 5): 'barkable' is declared here.
  input.ts(7, 21): Did you mean to call this expression?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Domain: Error MessagesThe issue relates to error messagingExperience EnhancementNoncontroversial enhancementsGood First IssueWell scoped, documented and has the green lightHelp WantedYou can do thisPursuitFellowshipHelp wanted from Pursuit fellowship; others please avoid until Dec 19SuggestionAn idea for TypeScript

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions