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

ChangedText.WithChanges crashes when new deletion larger than old #39405

Closed
RikkiGibson opened this issue Oct 20, 2019 · 0 comments · Fixed by #48420
Closed

ChangedText.WithChanges crashes when new deletion larger than old #39405

RikkiGibson opened this issue Oct 20, 2019 · 0 comments · Fixed by #48420
Assignees
Labels
Area-Compilers Bug Resolution-Fixed The bug has been fixed and/or the requested behavior has been implemented Tenet-Reliability Customer telemetry indicates that the product is failing in a crash/hang/dataloss manner.
Milestone

Comments

@RikkiGibson
Copy link
Contributor

Do we also need to handle the case where the new deletion is larger than the old? It looks like the following fails with or without this PR:

var original = SourceText.From("01234");
var change1 = original.WithChanges(new TextChange(new TextSpan(1, 3), "aa"));
var change2 = change1.WithChanges(new TextChange(new TextSpan(1, 3), "bb"));

var changes = change2.GetTextChanges(original);
Assert.Equal("0aa4", change1.ToString());
Assert.Equal("0bb", change2.ToString());

We can log a bug for this case and handle it separately.

Originally posted by @cston in #39258

/cc @ashmind

@RikkiGibson RikkiGibson added Bug help wanted The issue is "up for grabs" - add a comment if you are interested in working on it Area-Compilers labels Oct 20, 2019
@RikkiGibson RikkiGibson added this to the Backlog milestone Nov 27, 2019
@gafter gafter added the Tenet-Reliability Customer telemetry indicates that the product is failing in a crash/hang/dataloss manner. label Apr 17, 2020
@RikkiGibson RikkiGibson self-assigned this Oct 10, 2020
@sharwell sharwell modified the milestones: Backlog, 16.9.P1 Oct 14, 2020
@sharwell sharwell added Resolution-Fixed The bug has been fixed and/or the requested behavior has been implemented and removed help wanted The issue is "up for grabs" - add a comment if you are interested in working on it labels Oct 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compilers Bug Resolution-Fixed The bug has been fixed and/or the requested behavior has been implemented Tenet-Reliability Customer telemetry indicates that the product is failing in a crash/hang/dataloss manner.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants