-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed
Labels
Area-IDEBugFeature - Simple ProgramsTop-level statementsTop-level statementsResolution-FixedThe bug has been fixed and/or the requested behavior has been implementedThe bug has been fixed and/or the requested behavior has been implemented
Milestone
Description
Start with top-level statements:
local2(1, 2);
void local2(int x, int y)
{
}
Add a string literal as the 3rd argument at the call site of local2. Try to use "Add parameter" fix
Observed:
System.ArgumentOutOfRangeException : Specified argument was out of the range of valid values.
Parameter name: index
at Roslyn.Utilities.SpecializedCollections.Empty.List`1.get_Item(Int32 index)
at async Microsoft.CodeAnalysis.AddParameter.AddParameterService.AddParameterAsync(<Unknown Parameters>)
at async Microsoft.CodeAnalysis.AddParameter.AbstractAddParameterCodeFixProvider`6.FixAsync[TArgumentSyntax,TAttributeArgumentSyntax,TArgumentListSyntax,TAttributeArgumentListSyntax,TInvocationExpressionSyntax,TObjectCreationExpressionSyntax](<Unknown Parameters>)
at async Microsoft.CodeAnalysis.CodeActions.CodeAction.ComputeOperationsAsync(<Unknown Parameters>)
at async Microsoft.CodeAnalysis.CodeActions.CodeAction.GetPreviewOperationsAsync(<Unknown Parameters>)
at async Microsoft.CodeAnalysis.Editor.Implementation.Suggestions.SuggestedAction.GetPreviewResultAsync(<Unknown Parameters>)
at async Microsoft.CodeAnalysis.Editor.Implementation.Suggestions.SuggestedActionWithNestedFlavors.<>c__DisplayClass11_0.<GetPreviewAsync>b__0(<Unknown Parameters>)
at async Microsoft.CodeAnalysis.Extensions.IExtensionManagerExtensions.PerformFunctionAsync[T](<Unknown Parameters>)
at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)
Relates to #43563 (test plan for "top-level statements")
Metadata
Metadata
Assignees
Labels
Area-IDEBugFeature - Simple ProgramsTop-level statementsTop-level statementsResolution-FixedThe bug has been fixed and/or the requested behavior has been implementedThe bug has been fixed and/or the requested behavior has been implemented