Skip to content

Error messages are vague when types have same name #6334

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
DanielRosenwasser opened this issue Jan 4, 2016 · 0 comments · Fixed by #27065
Closed

Error messages are vague when types have same name #6334

DanielRosenwasser opened this issue Jan 4, 2016 · 0 comments · Fixed by #27065
Labels
Bug A bug in TypeScript Domain: Error Messages The issue relates to error messaging Effort: Moderate Requires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual". Help Wanted You can do this
Milestone

Comments

@DanielRosenwasser
Copy link
Member

Found through @LPGhatguy on Gitter at January 3, 2016 10:09 PM.

Seems like #1419 didn't have enough coverage. Try out the following:

  • m1.ts

    export interface A { a1; }
  • m2.ts

    export interface A { a2; }
  • m3.ts

    import * as m1 from "./m1";
    import * as m2 from "./m2";
    
    let x: m1.A;
    let y: m2.A;
    
    x = y;
    x === y;

Error messages:

Type 'A' is not assignable to type 'A'.
  Property 'a1' is missing in type 'A'.

Operator '===' cannot be applied to types 'A' and 'A'.

This is the worst error message you can give to a user.

@DanielRosenwasser DanielRosenwasser added Bug A bug in TypeScript Help Wanted You can do this Effort: Moderate Requires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual". Domain: Error Messages The issue relates to error messaging labels Jan 4, 2016
@mhegazy mhegazy added this to the Community milestone Jan 7, 2016
@mhegazy mhegazy added Help Wanted You can do this and removed Help Wanted You can do this labels Feb 20, 2016
@RyanCavanaugh RyanCavanaugh modified the milestones: Community, Backlog Mar 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Domain: Error Messages The issue relates to error messaging Effort: Moderate Requires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual". Help Wanted You can do this
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants