-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed
Labels
Area-IDEBugCommunityThe pull request was submitted by a contributor who is not a Microsoft employee.The pull request was submitted by a contributor who is not a Microsoft employee.
Description
Version Used:
Encountered in VS 2022 17.14.0 Preview 7.0. Also repro'ed in main.
Steps to Reproduce:
Attempt to convert the following code to a record:
namespace N
{
public abstract class C
{
public string? S { get; set; }
public abstract System.Guid F();
}
}Expected Behavior:
Conversion to record.
Actual Behavior:
Crash:
Stack Trace:
System.InvalidOperationException : Operation is not valid due to the current state of the object.
at Microsoft.CodeAnalysis.Shared.Extensions.SemanticModelExtensions.GetRequiredOperation(SemanticModel semanticModel,SyntaxNode node,CancellationToken cancellationToken)
at async Microsoft.CodeAnalysis.CSharp.ConvertToRecord.ConvertToRecordEngine.ConvertToPositionalRecordAsync(<Unknown Parameters>)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.CodeAnalysis.CodeActions.CodeAction.ComputeOperationsAsync(<Unknown Parameters>)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.CodeAnalysis.CodeActions.CodeAction.ComputePreviewOperationsAsync(<Unknown Parameters>)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.CodeAnalysis.CodeActions.CodeAction.GetPreviewOperationsAsync(<Unknown Parameters>)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.CodeAnalysis.Editor.Implementation.Suggestions.SuggestedAction.GetPreviewOperationsAsync(<Unknown Parameters>)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.CodeAnalysis.Editor.Implementation.Suggestions.SuggestedAction.GetPreviewResultAsync(<Unknown Parameters>)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.CodeAnalysis.Editor.Implementation.Suggestions.SuggestedActionWithNestedFlavors.<>c__DisplayClass16_0.<GetPreviewAsync>b__0(<Unknown Parameters>)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.CodeAnalysis.Extensions.IExtensionManagerExtensions.PerformFunctionAsync[T](<Unknown Parameters>)
Metadata
Metadata
Assignees
Labels
Area-IDEBugCommunityThe pull request was submitted by a contributor who is not a Microsoft employee.The pull request was submitted by a contributor who is not a Microsoft employee.
