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

Bug in CC0008 analyser for variable access. #324

Closed
thorgeirk11 opened this issue Apr 23, 2015 · 1 comment · Fixed by #326
Closed

Bug in CC0008 analyser for variable access. #324

thorgeirk11 opened this issue Apr 23, 2015 · 1 comment · Fixed by #326

Comments

@thorgeirk11
Copy link
Contributor

The CC0008 analyser does not check if the variable is used in the initialiser code.

class Point
{
    public Point(int x) { X = x; }

    public int X { get; set; }
    public int Y { get; set; }
}

void Foo()
{
    var myPoint = new Point(5);
    myPoint.Y = 5 + myPoint.X;
}

The refactored code has a compile error since the initializer cannot access the unassigned variable.

image

@giggio
Copy link
Member

giggio commented Apr 23, 2015

Bug confirmed.

@giggio giggio self-assigned this Apr 23, 2015
giggio added a commit to giggio/code-cracker that referenced this issue Apr 23, 2015
ElemarJR pushed a commit that referenced this issue Apr 23, 2015
Fix bug in CC0008 when accessing declaring variable (closes #324)
jwooley pushed a commit to jwooley/code-cracker that referenced this issue Sep 14, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants