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

EnC: Changing the type of a locked expression should be a rude edit #72240

Closed
jjonescz opened this issue Feb 23, 2024 · 1 comment
Closed

EnC: Changing the type of a locked expression should be a rude edit #72240

jjonescz opened this issue Feb 23, 2024 · 1 comment

Comments

@jjonescz
Copy link
Member

public void M()
{
    var x = new C();
    lock (x) {  }
}

When inside the lock statement body, changing from new C to new Lock or vice versa likely executes wrong unlocking code now (and probably crashes because the synthesized variables are not mapped correctly).

We should update EnC analyzer in the IDE to prohibit changes to the type of the lock expression around an active statement.

@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged Issues and PRs which have not yet been triaged by a lead label Feb 23, 2024
@arkalyanms arkalyanms added Feature Request and removed untriaged Issues and PRs which have not yet been triaged by a lead labels Apr 19, 2024
@tmat
Copy link
Member

tmat commented Sep 28, 2024

Fixed by #74526

@tmat tmat closed this as completed Sep 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants