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

Cleanup rule 1100 removes base #153

Closed
matkoch opened this issue Oct 24, 2017 · 2 comments
Closed

Cleanup rule 1100 removes base #153

matkoch opened this issue Oct 24, 2017 · 2 comments
Assignees

Comments

@matkoch
Copy link
Collaborator

matkoch commented Oct 24, 2017

Copied from https://youtrack.jetbrains.com/issue/RSPL-6925

When applying code clean up with rule 1100 ticked, in some instances "base" is changed to "this" incorrectly.

We have a class which inherits from List and a new Add(T item) method

We have the last line calling base.Add(T item) which is changed to this.Add(T item)

This causes (caused !!!) us an infinite loop (unit tests missing........)

public class ThingList : List<T>
{
    public void Add(T item)
    {
        ... custom code

        base.Add(item);
    }
}
@matkoch matkoch self-assigned this Oct 24, 2017
@matkoch
Copy link
Collaborator Author

matkoch commented Oct 24, 2017

StyleCop plugin is checking for new or override. I already changed this to compare the called member against the members of the declaring type. Will merge soon.

@matkoch matkoch closed this as completed Jan 12, 2018
@matkoch
Copy link
Collaborator Author

matkoch commented Jan 12, 2018

Fixed in 2017.3.0.

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

No branches or pull requests

1 participant