You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Version Used:
Visual Studio 17.12.0
c# project with language preview enabled
Steps to Reproduce:
In a type in:
private string? foo = null;
public string Foo
{
get
{
if (this.foo is null)
{
FieldInfo field = typeof(String).GetField(nameof(string.Length), BindingFlags.Public | BindingFlags.Instance)!;
this.foo = field.GetValue("hi");
}
return this.foo;
}
}
When typeing in the field.GetValue part, many provider errors are produced by Visual Studio
Expected Behavior:
no provider errors
Actual Behavior:
The call stack of all of them looks similar enough that I'll only include one.
Errors in:
UnnamedSymbolCompletionProvider
ExtensionMethodImportCompletionProvider
PreprocessorCompletionProvider
TypeImportCompletionProvider
KeywordCompletionProvider
EnumAndCompletionListTagCompletionProvider
AwaitCompletionProvider
System.InvalidOperationException : Unexpected value 'FooProj.FooClass.Foo.get' of type 'Microsoft.CodeAnalysis.CSharp.Symbols.SourcePropertyAccessorSymbol'
at Microsoft.CodeAnalysis.CSharp.Binder.BindFieldExpression(FieldExpressionSyntax node,BindingDiagnosticBag diagnostics)
at Microsoft.CodeAnalysis.CSharp.Binder.g__bindExpressionInternal|337_0(ExpressionSyntax node,BindingDiagnosticBag diagnostics,Boolean invoked,Boolean indexed)
at Microsoft.CodeAnalysis.CSharp.Binder.BindExpressionInternal(ExpressionSyntax node,BindingDiagnosticBag diagnostics,Boolean invoked,Boolean indexed)
at Microsoft.CodeAnalysis.CSharp.Binder.BindExpression(ExpressionSyntax node,BindingDiagnosticBag diagnostics,Boolean invoked,Boolean indexed)
at Microsoft.CodeAnalysis.CSharp.Binder.BindLeftOfPotentialColorColorMemberAccess(ExpressionSyntax left,BindingDiagnosticBag diagnostics)
at Microsoft.CodeAnalysis.CSharp.Binder.BindMemberAccess(MemberAccessExpressionSyntax node,Boolean invoked,Boolean indexed,BindingDiagnosticBag diagnostics)
at Microsoft.CodeAnalysis.CSharp.Binder.g__bindExpressionInternal|337_0(ExpressionSyntax node,BindingDiagnosticBag diagnostics,Boolean invoked,Boolean indexed)
at Microsoft.CodeAnalysis.CSharp.Binder.BindExpressionInternal(ExpressionSyntax node,BindingDiagnosticBag diagnostics,Boolean invoked,Boolean indexed)
at Microsoft.CodeAnalysis.CSharp.Binder.BindExpression(ExpressionSyntax node,BindingDiagnosticBag diagnostics,Boolean invoked,Boolean indexed)
at Microsoft.CodeAnalysis.CSharp.Binder.BindAssignment(AssignmentExpressionSyntax node,BindingDiagnosticBag diagnostics)
at Microsoft.CodeAnalysis.CSharp.Binder.g__bindExpressionInternal|337_0(ExpressionSyntax node,BindingDiagnosticBag diagnostics,Boolean invoked,Boolean indexed)
at Microsoft.CodeAnalysis.CSharp.Binder.BindExpressionInternal(ExpressionSyntax node,BindingDiagnosticBag diagnostics,Boolean invoked,Boolean indexed)
at Microsoft.CodeAnalysis.CSharp.Binder.BindExpression(ExpressionSyntax node,BindingDiagnosticBag diagnostics,Boolean invoked,Boolean indexed)
at Microsoft.CodeAnalysis.CSharp.Binder.BindExpressionStatement(CSharpSyntaxNode node,ExpressionSyntax syntax,Boolean allowsAnyExpression,BindingDiagnosticBag diagnostics)
at Microsoft.CodeAnalysis.CSharp.Binder.BindExpressionStatement(ExpressionStatementSyntax node,BindingDiagnosticBag diagnostics)
at Microsoft.CodeAnalysis.CSharp.Binder.BindStatement(StatementSyntax node,BindingDiagnosticBag diagnostics)
at Microsoft.CodeAnalysis.CSharp.Binder.BindBlockParts(BlockSyntax node,BindingDiagnosticBag diagnostics)
at Microsoft.CodeAnalysis.CSharp.Binder.BindBlock(BlockSyntax node,BindingDiagnosticBag diagnostics)
at Microsoft.CodeAnalysis.CSharp.Binder.BindStatement(StatementSyntax node,BindingDiagnosticBag diagnostics)
at Microsoft.CodeAnalysis.CSharp.Binder.BindPossibleEmbeddedStatement(StatementSyntax node,BindingDiagnosticBag diagnostics)
at Microsoft.CodeAnalysis.CSharp.Binder.BindIfStatement(IfStatementSyntax node,BindingDiagnosticBag diagnostics)
at Microsoft.CodeAnalysis.CSharp.Binder.BindStatement(StatementSyntax node,BindingDiagnosticBag diagnostics)
at Microsoft.CodeAnalysis.CSharp.Binder.BindBlockParts(BlockSyntax node,BindingDiagnosticBag diagnostics)
at Microsoft.CodeAnalysis.CSharp.Binder.BindBlock(BlockSyntax node,BindingDiagnosticBag diagnostics)
at Microsoft.CodeAnalysis.CSharp.Binder.BindStatement(StatementSyntax node,BindingDiagnosticBag diagnostics)
at Microsoft.CodeAnalysis.CSharp.MemberSemanticModel.EnsureNullabilityAnalysisPerformedIfNecessary()
at Microsoft.CodeAnalysis.CSharp.MemberSemanticModel.GetBoundNodes(CSharpSyntaxNode node)
at Microsoft.CodeAnalysis.CSharp.MemberSemanticModel.GetLowerBoundNode(CSharpSyntaxNode node)
at Microsoft.CodeAnalysis.CSharp.MemberSemanticModel.GetBoundNodes(CSharpSyntaxNode node,CSharpSyntaxNode& bindableNode,BoundNode& lowestBoundNode,BoundNode& highestBoundNode,BoundNode& boundParent)
at Microsoft.CodeAnalysis.CSharp.MemberSemanticModel.GetTypeInfoWorker(CSharpSyntaxNode node,CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.CSharp.SpeculativeSemanticModelWithMemberModel.GetTypeInfoWorker(CSharpSyntaxNode node,CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.CSharp.CSharpSemanticModel.GetTypeInfo(ExpressionSyntax expression,CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.CSharp.CSharpExtensions.GetTypeInfo(SemanticModel semanticModel,ExpressionSyntax expression,CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery.SyntaxTokenExtensions.IsNumericTypeContext(SyntaxToken token,SemanticModel semanticModel,CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery.CSharpSyntaxContext.CreateContextWorker(Document document,SemanticModel semanticModel,Int32 position,CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery.CSharpSyntaxContextService.CreateContext(Document document,SemanticModel semanticModel,Int32 position,CancellationToken cancellationToken)
at async Microsoft.CodeAnalysis.Completion.Utilities.CreateSyntaxContextWithExistingSpeculativeModelAsync()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.CodeAnalysis.CSharp.Completion.Providers.SpeculativeTCompletionProvider.ProvideCompletionsAsync()
at async Microsoft.CodeAnalysis.Completion.Providers.AbstractPreprocessorCompletionProvider.ProvideCompletionsAsync()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.CodeAnalysis.Extensions.IExtensionManagerExtensions.PerformActionAsync()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.CodeAnalysis.Shared.Extensions.DocumentExtensions.GetUnionItemsFromDocumentAndLinkedDocumentsAsyncT
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.CodeAnalysis.Completion.Providers.AbstractKeywordCompletionProvider`1.ProvideCompletionsAsyncTContext
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.CodeAnalysis.Extensions.IExtensionManagerExtensions.PerformActionAsync()
The text was updated successfully, but these errors were encountered:
Version Used:
Visual Studio 17.12.0
c# project with language preview enabled
Steps to Reproduce:
field.GetValue
part, many provider errors are produced by Visual StudioExpected Behavior:
no provider errors
Actual Behavior:
The call stack of all of them looks similar enough that I'll only include one.
Errors in:
The text was updated successfully, but these errors were encountered: