Skip to content

[Errors] Duplicate identifier X instead of Getter or Setter X already declared #95

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
mhegazy opened this issue Jul 17, 2014 · 1 comment
Labels
Bug A bug in TypeScript Effort: Moderate Requires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual". Help Wanted You can do this Won't Fix The severity and priority of this issue do not warrant the time or complexity needed to fix it

Comments

@mhegazy
Copy link
Contributor

mhegazy commented Jul 17, 2014

class C {    get x() { return 1; }    get x() { return 1; } // error}

class D {    set x(v) {  }    set x(v) {  } // error}

class E {    get x() {        return 1;    }    set x(v) { }}

var x = {    get x() {        return 1;    },

    // error    get x() {        return 1;    }}

var y = {    get x() {        return 1;    },    set x(v) { }}

Expected:

class C {
        get x() { return 1; }
        get x() { return 1; } // error
!!! Getter 'x' already declared.
    }

    class D {
        set x(v) {  }
        set x(v) {  } // error
!!! Setter 'x' already declared.
    }

    class E {
        get x() {
            return 1;
        }
        set x(v) { }
    }

    var x = {
        get x() {
            return 1;
        },

        // error
        get x() {
            return 1;
        }
!!! Getter 'x' already declared.
    }

    var y = {
        get x() {
            return 1;
        },
        set x(v) { }
    }

Actual:

    class C {
        get x() { return 1; }
        get x() { return 1; } // error
!!! Duplicate identifier 'x'.
    }

    class D {
        set x(v) {  }
        set x(v) {  } // error
!!! Duplicate identifier 'x'.
    }

    class E {
        get x() {
            return 1;
        }
        set x(v) { }
    }

    var x = {
        get x() {
            return 1;
        },

        // error
        get x() {
!!! Duplicate identifier 'x'.
            return 1;
        }
    }

    var y = {
        get x() {
            return 1;
        },
        set x(v) { }
    }
@mhegazy mhegazy added this to the TypeScript 1.2 milestone Jul 17, 2014
@sophiajt sophiajt modified the milestones: Community, TypeScript 1.3 Sep 8, 2014
@DanielRosenwasser DanielRosenwasser added Help Wanted You can do this Effort: Moderate Requires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual". labels Oct 7, 2015
@mhegazy
Copy link
Contributor Author

mhegazy commented Feb 20, 2016

Closing for housekeeping purposes. The behavior outlined in the OP has been in place for over 18 month now and have not got any updates on this issue. Please file a new issue if an action is required.

@mhegazy mhegazy closed this as completed Feb 20, 2016
@mhegazy mhegazy added the Won't Fix The severity and priority of this issue do not warrant the time or complexity needed to fix it label Feb 20, 2016
@mhegazy mhegazy removed this from the Community milestone Apr 26, 2018
@microsoft microsoft locked and limited conversation to collaborators Jul 31, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A bug in TypeScript Effort: Moderate Requires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual". Help Wanted You can do this Won't Fix The severity and priority of this issue do not warrant the time or complexity needed to fix it
Projects
None yet
Development

No branches or pull requests

4 participants