-
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
Expression variables declared in a local function parameter default are given a scope #16467
Conversation
…re given a scope Fixes dotnet#16167
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.
LGTM
@MattGertz This is for rc3 shiproom. |
LGTM |
Dogfood-reported, so OK to take to RC3. (Please don't add the pending label; I will do that.) |
Need clarity on the following before we can merge this change |
Shiproom moved to RTW. Please retarget PR |
parameter binders with appropriate containing symbol and flags.
@cston @AlekseyTs Please re-review one additional commit. |
@jaredpar Pending your approval. |
{ | ||
public static void Main(int arg) | ||
{ | ||
void Local2(bool b = M(M(out int z1), z1), int s2 = z1) {} |
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.
void Local2(bool b = M(M(out int z1), z1), int s2 = z1) {} [](start = 8, length = 58)
Consider adding a test where a variable declared within a default parameter value is referenced within the local function that owns the parameter. #Closed
LGTM, please consider adding a test suggested in #16467 (review) |
LGTM |
@MattGertz @natidea This is for RTM shiproom. |
I see this has been pre-approved for proactive integration into RTM per https://devdiv.visualstudio.com/0bdbc590-a062-4c3f-b0f6-9383f67865ee/_workitems?id=367236 |
Customer scenario
If you declare an expression variable (e.g. out variable) inside the default value
expression of a parameter to a local function, the IDE crashes.
Bugs this fixes:
Fixes #16167
Workarounds, if any
Don't make that mistake.
Risk
Small. Corrects a small oversight in the implementation of the interaction of new language features.
Performance impact
Trivial.
Is this a regression from a previous update?
No.
Root cause analysis:
Missing test for interaction between multiple new language features. Lack of dedicated testing team. Lack of coordinated testing role for new features and interactions between new features.
How was the bug found?
Customer reported. It occurred accidentally when the customer pasted XML inside a method body instead of inside the doc comment.
@jcouv @cston previously reviewed this fix in #16315; this moves it to the rc3 branch.