Skip to content

Give a better error message for assigning from Object to anything else #10462

Description

@DanielRosenwasser

Test code

declare var x: Object;
declare var y: RegExp;
y = x;

A lot of people misunderstand what Object is. We should consider trying to elaborate the issue in some way.

Type 'Object' is not assignable to type 'RegExp'.
  The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDomain: Error MessagesThe issue relates to error messagingEffort: ModerateRequires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".Help WantedYou can do this

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions