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

Version 16.11.0 Preview 2.0 - InvalidOperationException Unexpected false #54713

Closed
vsfeedback opened this issue Jul 9, 2021 · 2 comments
Closed
Assignees
Labels
Area-IDE Bug Developer Community The issue was originally reported on https://developercommunity.visualstudio.com
Milestone

Comments

@vsfeedback
Copy link

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


Highlighting the "1" in the following code throws a yellow bar error with a type of InvalidOperation 'Unexpected false'.

namespace Namespace
{
    public static class Class
    {
        private async FOO BAR
        {
            using (new ABC())
            {
            List<string> ParametersValues = new List<string>
                {
                "1"
                }
            }
        }
    }
}
System.InvalidOperationException : Unexpected false
   at Roslyn.Utilities.Contract.Fail(String message)
   at Roslyn.Utilities.Contract.ThrowIfFalse(Boolean condition)
   at Microsoft.CodeAnalysis.CSharp.ExtractMethod.CSharpMethodExtractor.CSharpCodeGenerator.ExpressionCodeGenerator.GetCallSiteContainerFromExpression()
   at Microsoft.CodeAnalysis.CSharp.ExtractMethod.CSharpMethodExtractor.CSharpCodeGenerator.ExpressionCodeGenerator.GetOutermostCallSiteContainerToProcess(CancellationToken cancellationToken)
   at async Microsoft.CodeAnalysis.ExtractMethod.MethodExtractor.CodeGenerator`3.GenerateAsync[TStatement,TExpression,TNodeUnderContainer](<Unknown Parameters>)
   at async Microsoft.CodeAnalysis.ExtractMethod.MethodExtractor.ExtractMethodAsync(<Unknown Parameters>)
   at async Microsoft.CodeAnalysis.ExtractMethod.AbstractExtractMethodService`3.ExtractMethodAsync[TValidator,TExtractor,TResult](<Unknown Parameters>)
   at async Microsoft.CodeAnalysis.CodeRefactorings.ExtractMethod.ExtractMethodCodeRefactoringProvider.ExtractMethodAsync(<Unknown Parameters>)
   at async Microsoft.CodeAnalysis.CodeRefactorings.ExtractMethod.ExtractMethodCodeRefactoringProvider.GetCodeActionsAsync(<Unknown Parameters>)
   at async Microsoft.CodeAnalysis.CodeRefactorings.ExtractMethod.ExtractMethodCodeRefactoringProvider.ComputeRefactoringsAsync(<Unknown Parameters>)
   at async Microsoft.CodeAnalysis.CodeRefactorings.CodeRefactoringService.GetRefactoringFromProviderAsync(<Unknown Parameters>)

Original Comments

Feedback Bot on 7/7/2021, 11:49 PM:

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)

@sharwell sharwell transferred this issue from dotnet/roslyn-analyzers Jul 9, 2021
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Jul 9, 2021
@jinujoseph jinujoseph added Bug Developer Community The issue was originally reported on https://developercommunity.visualstudio.com and removed untriaged Issues and PRs which have not yet been triaged by a lead labels Jul 9, 2021
@jinujoseph jinujoseph added this to the 17.0.P3 milestone Jul 9, 2021
@jinujoseph
Copy link
Contributor

@akhera99 can you validate if this is fixed , also #35435 seems in the same codepath

@jinujoseph jinujoseph modified the milestones: 17.0.P3, 17.0 Jul 27, 2021
@akhera99
Copy link
Member

Fixed with #53031

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE Bug Developer Community The issue was originally reported on https://developercommunity.visualstudio.com
Projects
None yet
Development

No branches or pull requests

3 participants