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

ChangeSignature isn't aware of nullability #30315

Closed
jcouv opened this issue Oct 4, 2018 · 6 comments
Closed

ChangeSignature isn't aware of nullability #30315

jcouv opened this issue Oct 4, 2018 · 6 comments
Assignees
Labels
Area-IDE Concept-Continuous Improvement New Language Feature - Nullable Reference Types Nullable Reference Types Resolution-Fixed The bug has been fixed and/or the requested behavior has been implemented
Milestone

Comments

@jcouv
Copy link
Member

jcouv commented Oct 4, 2018

  1. The popup dialog doesn't display nullability annotations (?).
  2. Changing the order of parameters on a signature involving nullability causes a crash.

image

FYI @dpoeschl

@CyrusNajmabadi
Copy link
Member

That's concerning. What's the crash? Does that indicate some change in behavior in existing APIs that is not compatible with previous contracts?

@jcouv
Copy link
Member Author

jcouv commented Oct 10, 2018

The crash shows an InvalidOperationException with WaitAndGetResult cannot be called from a thread pool thread.. That doesn't look related to nullability.
This is on 15.9 preview 1.

@dpoeschl Does this look familiar by any chance?

   at Roslyn.Utilities.TaskExtensions.WaitAndGetResult[T](Task`1 task, CancellationToken cancellationToken) in C:\repos\roslyn\src\Workspaces\Core\Portable\Utilities\TaskExtensions.cs:line 75
   at Microsoft.CodeAnalysis.ChangeSignature.AbstractChangeSignatureService.TryCreateUpdatedSolution(ChangeSignatureAnalyzedContext context, ChangeSignatureOptionsResult options, CancellationToken cancellationToken, Solution& updatedSolution) in C:\repos\roslyn\src\Features\Core\Portable\ChangeSignature\AbstractChangeSignatureService.cs:line 209
   at Microsoft.CodeAnalysis.ChangeSignature.AbstractChangeSignatureService.ChangeSignatureWithContext(ChangeSignatureAnalyzedContext context, ChangeSignatureOptionsResult options, CancellationToken cancellationToken) in C:\repos\roslyn\src\Features\Core\Portable\ChangeSignature\AbstractChangeSignatureService.cs:line 160
   at Microsoft.CodeAnalysis.ChangeSignature.ChangeSignatureCodeAction.ComputeOperationsAsync(Object options, CancellationToken cancellationToken) in C:\repos\roslyn\src\Features\Core\Portable\ChangeSignature\ChangeSignatureCodeAction.cs:line 33
   at Microsoft.CodeAnalysis.CodeActions.CodeActionWithOptions.<GetOperationsAsync>d__1.MoveNext() in C:\repos\roslyn\src\Workspaces\Core\Portable\CodeActions\CodeActionWithOptions.cs:line 37
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Roslyn.Utilities.TaskExtensions.WaitAndGetResult_CanCallOnBackground[T](Task`1 task, CancellationToken cancellationToken) in C:\repos\roslyn\src\Workspaces\Core\Portable\Utilities\TaskExtensions.cs:line 87
   at Roslyn.Utilities.TaskExtensions.WaitAndGetResult[T](Task`1 task, CancellationToken cancellationToken) in C:\repos\roslyn\src\Workspaces\Core\Portable\Utilities\TaskExtensions.cs:line 74
   at Microsoft.CodeAnalysis.Editor.Implementation.Suggestions.SuggestedAction.InvokeWorker(Func`1 getFromDocument, IProgressTracker progressTracker, CancellationToken cancellationToken) in C:\repos\roslyn\src\EditorFeatures\Core.Wpf\Suggestions\SuggestedActions\SuggestedAction.cs:line 153
   at Microsoft.CodeAnalysis.Editor.Implementation.Suggestions.SuggestedAction.<>c__DisplayClass18_0.<InvokeCore>b__0() in C:\repos\roslyn\src\EditorFeatures\Core.Wpf\Suggestions\SuggestedActions\SuggestedAction.cs:line 138
   at Microsoft.CodeAnalysis.Extensions.IExtensionManagerExtensions.PerformAction(IExtensionManager extensionManager, Object extension, Action action) in C:\repos\roslyn\src\Workspaces\Core\Portable\ExtensionManager\IExtensionManagerExtensions.cs:line 23

@dpoeschl
Copy link
Contributor

Yeah, seems unrelated. Probably need to do something like #29484 here as well

@dpoeschl
Copy link
Contributor

Should have emphasized the "seems". It's reproing in this scenario for you?

@jcouv
Copy link
Member Author

jcouv commented Oct 10, 2018

Yes, I repro'ed this on two machines (work and home). Both with 15.9.
In one case I used the async-streams branch as-is, in the other case I used a merge of dev16.0.x into the async-streams branch (this is where the stacktrace was taken from).
I will try again this afternoon with plain dev16.0.x for comparison.

@jcouv jcouv modified the milestones: 16.0.P2, 16.0 Nov 11, 2018
@jinujoseph jinujoseph modified the milestones: 16.0, 16.1 Jan 16, 2019
@jinujoseph jinujoseph modified the milestones: 16.1, Backlog Apr 24, 2019
@jasonmalinowski
Copy link
Member

Confirmed that the crash is badness in this code doing async-over-sync-over-async and isn't related to nullable -- if you remove the assert it works just fine. That's also asserting in literally any application, so it's not new.

@jasonmalinowski jasonmalinowski self-assigned this Jun 20, 2019
@jasonmalinowski jasonmalinowski modified the milestones: Backlog, 16.4.P1 Aug 20, 2019
@jinujoseph jinujoseph modified the milestones: 16.4.P1, 16.4, Backlog Oct 9, 2019
@sharwell sharwell modified the milestones: Backlog, 16.5.P1 Nov 6, 2019
@sharwell sharwell added the Resolution-Fixed The bug has been fixed and/or the requested behavior has been implemented label Nov 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE Concept-Continuous Improvement New Language Feature - Nullable Reference Types Nullable Reference Types Resolution-Fixed The bug has been fixed and/or the requested behavior has been implemented
Projects
None yet
Development

No branches or pull requests

6 participants