-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed
Labels
Area-IDEBugIDE-CodeStyleBuilt-in analyzers, fixes, and refactoringsBuilt-in analyzers, fixes, and refactoringsResolution-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
Version Used:
Microsoft Visual Studio Professional 2019 Preview
Version 16.6.0 Preview 6.0
VisualStudio.16.Preview/16.6.0-pre.6.0+30105.148
Microsoft .NET Framework
Version 4.8.03752
Steps to Reproduce:
Place caret at null in the following code:
using System.Threading;
#nullable enable
class C
{
void M1()
{
string _path = "";
var path = Interlocked.Exchange(ref _path, null);
}
}
Expected Behavior:
No exceptions
System.IndexOutOfRangeException : Index was outside the bounds of the array.
at Microsoft.CodeAnalysis.CSharp.CodeFixes.DeclareAsNullable.CSharpDeclareAsNullableCodeFixProvider.<TryGetDeclarationTypeToFix>g__TryGetParameterTypeSyntax|13_2(IParameterSymbol parameterSymbol)
at Microsoft.CodeAnalysis.CSharp.CodeFixes.DeclareAsNullable.CSharpDeclareAsNullableCodeFixProvider.TryGetDeclarationTypeToFix(SemanticModel model,SyntaxNode node)
at async Microsoft.CodeAnalysis.CSharp.CodeFixes.DeclareAsNullable.CSharpDeclareAsNullableCodeFixProvider.RegisterCodeFixesAsync(<Unknown Parameters>)
at async Microsoft.CodeAnalysis.CodeFixes.CodeFixService.GetCodeFixesAsync(<Unknown Parameters>)
at async Microsoft.CodeAnalysis.Extensions.IExtensionManagerExtensions.PerformFunctionAsync[T](<Unknown Parameters>)
at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Area-IDEBugIDE-CodeStyleBuilt-in analyzers, fixes, and refactoringsBuilt-in analyzers, fixes, and refactoringsResolution-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
