Skip to content
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

Getters and setters cannot have same name #397

Closed
keertip opened this issue Nov 9, 2011 · 3 comments
Closed

Getters and setters cannot have same name #397

keertip opened this issue Nov 9, 2011 · 3 comments
Assignees

Comments

@keertip
Copy link
Contributor

keertip commented Nov 9, 2011

The model does not allow getters and setters of the same name. In the Outline view, the method name shows up twice, but they both point to just one of the methods.

@bwilkerson
Copy link
Member

I believe the issue is that we are creating multiple (two in this case) method elements with the same name. As a result they are all equals(), which means that the info for one will overwrite the info for the first. The solution is to make them unique. The hard part is that we don't currently have a good way to do that.

Note that this will also be a problem for incorrect code, such as code in which the user has attempted to overload a method name. Our model ought to be able to represent this, but currently cannot.

The most straightforward solution I can think of at the moment is to use the occurrenceCount field to differentiate between these elements. (Accessing other data doesn't work because we need to access the info to get it, which requires a hash table lookup, which leads to an infinite loop.)

@bwilkerson
Copy link
Member

Set owner to @bwilkerson.
Added Started label.

@bwilkerson
Copy link
Member

Fixed by http://codereview.chromium.org/8527002/


Added Fixed label.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants