-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Conversation
@agocke, @RikkiGibson, @cston, @jcouv, @dotnet/roslyn-compiler Please review, need a second sign-off, the amount of changes is small. |
); | ||
|
||
TestLookupNames(text, expectedNames); | ||
} |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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)); | ||
} |
There was a problem hiding this comment.
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
FYI, resolved conflicts following Chuck's PR. |
@jcouv there are analyzer diagnostics in the Correctness run. |
https://github.com/dotnet/csharplang/blob/master/meetings/2020/LDM-2020-06-01.md
Also fixes #44879.