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

Y0002 codefix crash for 'foreach (var (a, b) in x)' #33

Open
Youssef1313 opened this issue Mar 14, 2021 · 0 comments
Open

Y0002 codefix crash for 'foreach (var (a, b) in x)' #33

Youssef1313 opened this issue Mar 14, 2021 · 0 comments
Labels
bug Something isn't working code-fix

Comments

@Youssef1313
Copy link
Owner

Youssef1313 commented Mar 14, 2021

StackTrace:

System.NullReferenceException : Object reference not set to an instance of an object.
   at Microsoft.CodeAnalysis.CSharp.Extensions.ITypeSymbolExtensions.GenerateTypeSyntax(INamespaceOrTypeSymbol symbol,Boolean nameSyntax,Boolean allowVar)
   at Microsoft.CodeAnalysis.CSharp.CodeGeneration.CSharpSyntaxGenerator.TypeExpression(ITypeSymbol typeSymbol)
   at async YAnalyzers.CSharp.UseImplicitOrExplicitTypeCodeFix.UseExplicitTypeAsync(<Unknown Parameters>)
   at async Microsoft.CodeAnalysis.CodeActions.CodeAction.GetChangedSolutionAsync(<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>)

The form foreach (var (a, b) in x) should be converted into foreach ((TypeA a, TypeB b) in x)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working code-fix
Projects
None yet
Development

No branches or pull requests

1 participant