-
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
Compiler shouldn't emit hidden sequence points on display class creation instruction in expression context #37237
Milestone
Comments
tmat
added a commit
to tmat/roslyn
that referenced
this issue
Jul 15, 2019
Update calculation of syntax offset to account for a new case when a node (a switch expression) that is associated with a variable, closure or lambda may share start offset with other node of the same kind (`expr switch { … } switch { … }`). Use the offset of the `switch` keyword instead of the starting offset of the expression to disambiguate. Assign ordinals to variables synthesized for storing pattern values across cases. This is required to support complex patterns since we can no longer rely on the type of these variables to be distinct. This will require follow up in the IDE to disallow updating/adding/reordering the case clauses of switch expression which there an active statement is present within the switch statement. If the cases are unmodified the compiler guarantees that the order in which the synthesized variables are generated remains the same, so we can map the variables using their ordinal. Mark all variables synthesized during lowering of switch expression as short-lived. Their lifespan is limited to the switch expression, which does not include a sequence point. Disallow editing methods that contain switch expression. This is necessary until bugs dotnet#37232, dotnet#37237 are fixed.
Related issue: #37261 |
tmat
added a commit
that referenced
this issue
Jul 16, 2019
* Fix EnC debug information emitted for patterns Update calculation of syntax offset to account for a new case when a node (a switch expression) that is associated with a variable, closure or lambda may share start offset with other node of the same kind (`expr switch { … } switch { … }`). Use the offset of the `switch` keyword instead of the starting offset of the expression to disambiguate. Assign ordinals to variables synthesized for storing pattern values across cases. This is required to support complex patterns since we can no longer rely on the type of these variables to be distinct. This will require follow up in the IDE to disallow updating/adding/reordering the case clauses of switch expression which there an active statement is present within the switch statement. If the cases are unmodified the compiler guarantees that the order in which the synthesized variables are generated remains the same, so we can map the variables using their ordinal. Mark all variables synthesized during lowering of switch expression as short-lived. Their lifespan is limited to the switch expression, which does not include a sequence point. Disallow editing methods that contain switch expression. This is necessary until bugs #37232, #37237 are fixed. * Feedback * Update tests
8 tasks
gafter
added a commit
to gafter/roslyn
that referenced
this issue
Aug 21, 2019
…ion instruction in expression context Fixes dotnet#37237 Compiler emits incorrect EnC closure data to PDB for nested switch expressions Fixes dotnet#37232 Expression bodied method whose expression is a switch expression is missing debug info Fixes dotnet#37261
5 tasks
This issue was closed.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
PDB contains sequence points
The one at offset 0x5b shouldn't be emitted since it's in the middle of expression evaluation:
If we decide to merge closure scopes of the nested switch expressions to fix #37232, this issue will be resolved as well. If we decide to keep both closures then we need to avoid emitting the hidden sequence point on the inner one.
See test
PDBTests.Patterns_SwitchExpression_Closures
.As it turns out, the outer hidden sequence point is also problematic: see #37261
The text was updated successfully, but these errors were encountered: