Skip to content

Improve error messages for duplicate identifiers #529

@mhegazy

Description

@mhegazy

We need to split the "Duplicate identifier" error in to a suite of more detailed errors about various types of illegal merges. "Duplicate identifier" is too general. Some examples of cases that warrant their own message:

  • Would be a legal merge (like module & module) but exports don't match
  • Fundule in the wrong order
  • Clodule in the wrong order
  • Fundule in different files
  • Clodule in different files
  • Interface and enum can't merge
  • Interface and class can't merge
  • Class and enum can't merge
  • Function and enum can't merge

Basically every illegal cell in the matrix of merges should have a separate error message (or some of them can be grouped together in terms of value/type/namespace space). For example:

Class cannot merge with any other type

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