Skip to content

Visual Studio crashes when adding a parameter to a function #40451

@vsfeedback

Description

@vsfeedback

This issue has been moved from a ticket on Developer Community.


[regression] [worked-in:16.4]
I have a method with two overloads:

Private Function MonthToActualYearMonth(ByVal theMonth As MyEnumType) As Integer
Public Shared Function MonthToActualYearMonth(ByVal theYear As Integer, ByVal theMonth As MyEnumType) As Integer

And a line of code calling the wrong method:
Dim aBla = MonthToActualYearMonth(myMonth)

I get a squigly red line underneath the method call with the following error (which is correct):
Cannot refer to an instance member of a class from within a shared method or shared member initializer without an explicit instance of the class.

I want to add the missing parameter to use the shared method instead of the private function. I add my cursor after the first parentheses and start typing to add the missing parameter. When I finally type the "," Visual Studio crashes.

In the Event Viewer in Windows I find the following back:

Application: devenv.exe
Framework Version: v4.0.30319
Description: The application requested process termination through System.Environment.FailFast(string message).
Message: System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
   at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
   at System.Collections.Generic.List`1.get_Item(Int32 index)
   at Microsoft.CodeAnalysis.SignatureHelp.AbstractSignatureHelpProvider.Filter(IList`1 items, IEnumerable`1 parameterNames, Nullable`1 selectedItem)
   at Microsoft.CodeAnalysis.SignatureHelp.AbstractSignatureHelpProvider.CreateSignatureHelpItems(IList`1 items, TextSpan applicableSpan, SignatureHelpState state, Nullable`1 selectedItem)
   at Microsoft.CodeAnalysis.VisualBasic.SignatureHelp.InvocationExpressionSignatureHelpProvider.VB$StateMachine_16_GetItemsWorkerAsync.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at Microsoft.CodeAnalysis.SignatureHelp.AbstractSignatureHelpProvider.<GetItemsAsync>d__16.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.CodeAnalysis.Editor.Implementation.IntelliSense.SignatureHelp.Controller.Session.<ComputeItemsAsync>d__9.MoveNext()
Stack:
   at System.Environment.FailFast(System.String, System.Exception)
   at Microsoft.CodeAnalysis.FailFast.OnFatalException(System.Exception)
   at Microsoft.CodeAnalysis.ErrorReporting.FatalError.Report(System.Exception, System.Action`1<System.Exception>)
   at Microsoft.CodeAnalysis.ErrorReporting.FatalError.ReportUnlessCanceled(System.Exception)
   at Microsoft.CodeAnalysis.Editor.Implementation.IntelliSense.SignatureHelp.Controller+Session+<ComputeItemsAsync>d__9.MoveNext()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)
   at Microsoft.CodeAnalysis.Editor.Implementation.IntelliSense.SignatureHelp.Controller+Session+<ComputeItemsAsync>d__9.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.ValueTuple`2[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Start[[Microsoft.CodeAnalysis.Editor.Implementation.IntelliSense.SignatureHelp.Controller+Session+<ComputeItemsAsync>d__9, Microsoft.CodeAnalysis.EditorFeatures, Version=3.4.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<ComputeItemsAsync>d__9 ByRef)
   at Microsoft.CodeAnalysis.Editor.Implementation.IntelliSense.SignatureHelp.Controller+Session.ComputeItemsAsync(System.Collections.Immutable.ImmutableArray`1<Microsoft.CodeAnalysis.SignatureHelp.ISignatureHelpProvider>, Microsoft.VisualStudio.Text.SnapshotPoint, Microsoft.CodeAnalysis.SignatureHelp.SignatureHelpTriggerInfo, Microsoft.CodeAnalysis.Document, System.Threading.CancellationToken)
   at Microsoft.CodeAnalysis.Editor.Implementation.IntelliSense.SignatureHelp.Controller+Session+<ComputeModelInBackgroundAsync>d__4.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Start[[Microsoft.CodeAnalysis.Editor.Implementation.IntelliSense.SignatureHelp.Controller+Session+<ComputeModelInBackgroundAsync>d__4, Microsoft.CodeAnalysis.EditorFeatures, Version=3.4.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<ComputeModelInBackgroundAsync>d__4 ByRef)
   at Microsoft.CodeAnalysis.Editor.Implementation.IntelliSense.SignatureHelp.Controller+Session.ComputeModelInBackgroundAsync(Microsoft.CodeAnalysis.Editor.Implementation.IntelliSense.SignatureHelp.Model, System.Collections.Immutable.ImmutableArray`1<Microsoft.CodeAnalysis.SignatureHelp.ISignatureHelpProvider>, Microsoft.VisualStudio.Text.SnapshotPoint, Microsoft.CodeAnalysis.Editor.Implementation.IntelliSense.DisconnectedBufferGraph, Microsoft.CodeAnalysis.SignatureHelp.SignatureHelpTriggerInfo, System.Threading.CancellationToken)
   at Microsoft.CodeAnalysis.Editor.Implementation.IntelliSense.SignatureHelp.Controller+Session+<>c__DisplayClass3_0.<ComputeModel>b__0(Microsoft.CodeAnalysis.Editor.Implementation.IntelliSense.SignatureHelp.Model, System.Threading.CancellationToken)
   at Microsoft.CodeAnalysis.Editor.Implementation.IntelliSense.ModelComputation`1+<>c__DisplayClass17_0[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].<ChainTaskAndNotifyControllerWhenFinished>b__0(System.Threading.Tasks.Task`1<System.__Canon>)
   at Roslyn.Utilities.TaskExtensions+<>c__DisplayClass15_0`2[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].<SafeContinueWithFromAsync>b__0(System.Threading.Tasks.Task)
   at System.Threading.Tasks.ContinuationResultTaskFromTask`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].InnerInvoke()
   at System.Threading.Tasks.Task.Execute()
   at System.Threading.Tasks.Task.ExecutionContextCallback(System.Object)
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(System.Threading.Tasks.Task ByRef)
   at System.Threading.Tasks.Task.ExecuteEntry(Boolean)
   at System.Threading.Tasks.Task.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()

Original Comments

Visual Studio Feedback System on 12/13/2019, 02:00 AM:

We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.


Original Solutions

(no solutions)

Metadata

Metadata

Assignees

Labels

Area-IDEBugDeveloper CommunityThe issue was originally reported on https://developercommunity.visualstudio.comIDE-IntelliSenseCompletion, Signature Help, Quick InfoTenet-ReliabilityCustomer telemetry indicates that the product is failing in a crash/hang/dataloss manner.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions