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

"Rename" refactor does not work on tuple fields #19578

Open
mkrueger opened this issue May 17, 2017 · 4 comments
Open

"Rename" refactor does not work on tuple fields #19578

mkrueger opened this issue May 17, 2017 · 4 comments
Assignees
Labels
Area-IDE Bug Feature - Rename help wanted The issue is "up for grabs" - add a comment if you are interested in working on it
Milestone

Comments

@mkrueger
Copy link
Contributor

mkrueger commented May 17, 2017

Got a bug report:

Refactoring of a tuple, does not update the tuple values:

var j = (int rune, int value);
j.rune

Refactoring rune above to a new name does not update the code below.

My use case was:

(int rune, int value) j = (5, 3);
j.rune = 5;

Got an exception on rename:

System.NullReferenceException: Object reference not set to an instance of an object
  at Microsoft.CodeAnalysis.Rename.ConflictEngine.ConflictResolver+<AddDeclarationConflictsAsync>d__9.MoveNext () [0x001cd] in <62ecf748d8c54ce99002ae42d41637ec>:0 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /home/mkrueger/work/mono/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:151 
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00037] in /home/mkrueger/work/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:187 
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in /home/mkrueger/work/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:156 
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in /home/mkrueger/work/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:128 
  at System.Runtime.CompilerServices.ConfiguredTaskAwaitable+ConfiguredTaskAwaiter.GetResult () [0x00000] in /home/mkrueger/work/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:447 
  at Microsoft.CodeAnalysis.Rename.ConflictEngine.ConflictResolver+Session+<IdentifyConflictsAsync>d__19.MoveNext () [0x00d0b] in <62ecf748d8c54ce99002ae42d41637ec>:0 
@sharwell
Copy link
Member

sharwell commented May 17, 2017

💭 I see other past bugs related to renaming tuple elements, but none that I can claim is a duplicate of this. Seems the current status of this feature is it's known to not work and supposed to show a dialog telling you so, but seems you saw a crash instead. Makes me wonder if someone tried to implement the functionality but missed this case.

@Pilchie
Copy link
Member

Pilchie commented May 17, 2017

@jcouv or @dpoeschl do you know the expected current state here?

@jcouv
Copy link
Member

jcouv commented May 17, 2017

Two things:

  • var j = (int rune, int value); is not valid code. Was that produced by the refactoring, or was that code you tried to refactor?
  • renaming tuple element names is currently blocked (see Cannot rename named tuples #14115)

@Pilchie Pilchie added this to the 15.3 milestone May 17, 2017
@MattGertz MattGertz modified the milestones: 15.6, 15.3 May 28, 2017
@mkrueger
Copy link
Contributor Author

The thing is that I get code reported that is not valid. It's ok for a rename not working on invalid code.

But that shouldn't be done via an unhandled exception :).

@dpoeschl dpoeschl modified the milestones: 15.5, 15.later Sep 26, 2017
@jcouv jcouv changed the title Refactoring tuple values does not work "Rename" refactor does not work on tuple fields Oct 31, 2017
@jinujoseph jinujoseph modified the milestones: 15.6, Unknown Nov 3, 2017
@vatsalyaagrawal vatsalyaagrawal modified the milestones: Backlog, 16.6 Mar 17, 2020
@jinujoseph jinujoseph modified the milestones: 16.6, Backlog Apr 19, 2020
@jinujoseph jinujoseph added the help wanted The issue is "up for grabs" - add a comment if you are interested in working on it label Apr 19, 2020
@github-project-automation github-project-automation bot moved this to InQueue in Small Fixes Oct 22, 2024
@CyrusNajmabadi CyrusNajmabadi assigned Cosifne and unassigned ryzngard Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE Bug Feature - Rename help wanted The issue is "up for grabs" - add a comment if you are interested in working on it
Projects
Status: InQueue
Development

No branches or pull requests

10 participants