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

Put record parameters in scope withing instance initializers #44906

Merged
merged 5 commits into from
Jun 6, 2020

Conversation

AlekseyTs
Copy link
Contributor

@AlekseyTs
Copy link
Contributor Author

@agocke, @RikkiGibson, @cston, @jcouv, @dotnet/roslyn-compiler Please review, need a second sign-off, the amount of changes is small.

);

TestLookupNames(text, expectedNames);
}
Copy link
Member

@cston cston Jun 6, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider testing a const field as well. #Resolved

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider testing a const field as well.

Const fields are static fields, so I am pretty confident this test is fairly equivalent to verify scoping rules. I will add a test like that for completeness sake in a separate PR


In reply to: 436281327 [](ancestors = 436281327)

Assert.Equal("System.Int32 C.Z", model.GetEnclosingSymbol(x.SpanStart).ToTestDisplayString());
Assert.Contains(symbol, model.LookupSymbols(x.SpanStart, name: "X"));
Assert.Contains("X", model.LookupNames(x.SpanStart));
}
Copy link
Member

@cston cston Jun 6, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider testing capturing:

record C(int X)
{
    Func<int> F = () => X;
}
``` #Resolved

@jcouv
Copy link
Member

jcouv commented Jun 6, 2020

FYI, resolved conflicts following Chuck's PR.

@RikkiGibson
Copy link
Contributor

@jcouv there are analyzer diagnostics in the Correctness run.

@jcouv jcouv merged commit a646747 into dotnet:features/records Jun 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants