Skip to content

Imperfect error message for invoking null literal as function #20026

@rhys-vdw

Description

@rhys-vdw

TypeScript Version: 2.6.1

Code

Minimal:

null()

Actual real-world mistake:

str !== 'hello' && thing !== null (
  <div>blah</div>
)

Expected behavior:

Clear error to the effect of:

Invoking 'null' as a function

Actual behavior:

Technically correct but slightly misleading error:

Object is possibly 'null'

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDomain: Error MessagesThe issue relates to error messagingFixedA PR has been merged for this issueGood First IssueWell scoped, documented and has the green lightHelp WantedYou can do this

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions