We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
KeyNotFoundException
goto
Version Used: VS 17.10.0 Preview 4.0, assuming most recent roslyn is bundled
Steps to Reproduce:
bar: System.Action t = () => { using System.IDisposable foo = null; goto bar; };
sharplab
Expected Behavior: Compilation error(s)
Actual Behavior:
System.Collections.Generic.KeyNotFoundException: The given key 'bar' was not present in the dictionary.
StreamJsonRpc.RemoteInvocationException: The given key 'bar' was not present in the dictionary. at StreamJsonRpc.JsonRpc.d__154`1.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.CodeAnalysis.Remote.BrokeredServiceConnection`1.d__18`1.MoveNext() RPC server exception: System.Collections.Generic.KeyNotFoundException: The given key 'bar' was not present in the dictionary. at System.Collections.Generic.Dictionary`2.get_Item(TKey key) at Microsoft.CodeAnalysis.CSharp.ControlFlowPass.VisitGotoStatement(BoundGotoStatement node) at Microsoft.CodeAnalysis.CSharp.ControlFlowPass.Visit(BoundNode node) at Microsoft.CodeAnalysis.CSharp.ControlFlowPass.VisitStatement(BoundStatement statement) at Microsoft.CodeAnalysis.CSharp.AbstractFlowPass`2.VisitStatements(ImmutableArray`1 statements) at Microsoft.CodeAnalysis.CSharp.ControlFlowPass.VisitBlock(BoundBlock node) at Microsoft.CodeAnalysis.CSharp.ControlFlowPass.Visit(BoundNode node) at Microsoft.CodeAnalysis.CSharp.AbstractFlowPass`2.Scan(Boolean& badRegion) at Microsoft.CodeAnalysis.CSharp.ControlFlowPass.Scan(Boolean& badRegion) at Microsoft.CodeAnalysis.CSharp.AbstractFlowPass`2.Analyze(Boolean& badRegion, Optional`1 initialState) at Microsoft.CodeAnalysis.CSharp.ControlFlowPass.Analyze(Boolean& badRegion, DiagnosticBag diagnostics) at Microsoft.CodeAnalysis.CSharp.ControlFlowPass.Analyze(CSharpCompilation compilation, Symbol member, BoundBlock block, DiagnosticBag diagnostics) at Microsoft.CodeAnalysis.CSharp.UnboundLambdaState.ReallyBind(NamedTypeSymbol delegateType, Boolean inExpressionTree) at Microsoft.CodeAnalysis.CSharp.UnboundLambdaState.Bind(NamedTypeSymbol delegateType, Boolean isTargetExpressionTree) at Microsoft.CodeAnalysis.CSharp.ConversionsBase.IsAnonymousFunctionCompatibleWithDelegate(UnboundLambda anonymousFunction, TypeSymbol type, CSharpCompilation compilation, Boolean isTargetExpressionTree) at Microsoft.CodeAnalysis.CSharp.ConversionsBase.IsAnonymousFunctionCompatibleWithType(UnboundLambda anonymousFunction, TypeSymbol type, CSharpCompilation compilation) at Microsoft.CodeAnalysis.CSharp.ConversionsBase.HasAnonymousFunctionConversion(BoundExpression source, TypeSymbol destination, CSharpCompilation compilation) at Microsoft.CodeAnalysis.CSharp.ConversionsBase.ClassifyImplicitBuiltInConversionFromExpression(BoundExpression sourceExpression, TypeSymbol source, TypeSymbol destination, CompoundUseSiteInfo`1& useSiteInfo) at Microsoft.CodeAnalysis.CSharp.ConversionsBase.ClassifyImplicitConversionFromExpression(BoundExpression sourceExpression, TypeSymbol destination, CompoundUseSiteInfo`1& useSiteInfo) at Microsoft.CodeAnalysis.CSharp.ConversionsBase.ClassifyConversionFromExpression(BoundExpression sourceExpression, TypeSymbol destination, Boolean isChecked, CompoundUseSiteInfo`1& useSiteInfo, Boolean forCast) at Microsoft.CodeAnalysis.CSharp.Binder.GenerateConversionForAssignment(TypeSymbol targetType, BoundExpression expression, BindingDiagnosticBag diagnostics, Conversion& conversion, ConversionForAssignmentFlags flags) at Microsoft.CodeAnalysis.CSharp.Binder.BindVariableDeclaration(SourceLocalSymbol localSymbol, LocalDeclarationKind kind, Boolean isVar, VariableDeclaratorSyntax declarator, TypeSyntax typeSyntax, TypeWithAnnotations declTypeOpt, AliasSymbol aliasOpt, BindingDiagnosticBag diagnostics, Boolean includeBoundType, CSharpSyntaxNode associatedSyntaxNode) at Microsoft.CodeAnalysis.CSharp.Binder.BindDeclarationStatementParts(LocalDeclarationStatementSyntax node, BindingDiagnosticBag diagnostics) at Microsoft.CodeAnalysis.CSharp.Binder.BindLocalDeclarationStatement(LocalDeclarationStatementSyntax node, BindingDiagnosticBag diagnostics) at Microsoft.CodeAnalysis.CSharp.Binder.BindStatement(StatementSyntax node, BindingDiagnosticBag diagnostics) at Microsoft.CodeAnalysis.CSharp.Binder.BindLabeled(LabeledStatementSyntax node, BindingDiagnosticBag diagnostics) at Microsoft.CodeAnalysis.CSharp.Binder.BindStatement(StatementSyntax node, BindingDiagnosticBag diagnostics) at Microsoft.CodeAnalysis.CSharp.Binder.BindSimpleProgramCompilationUnit(CompilationUnitSyntax compilationUnit, BindingDiagnosticBag diagnostics) at Microsoft.CodeAnalysis.CSharp.MethodCompiler.BindMethodBody(MethodSymbol method, TypeCompilationState compilationState, BindingDiagnosticBag diagnostics, Boolean includeInitializersInBody, BoundNode initializersBody, Boolean reportNullableDiagnostics, ImportChain& importChain, Boolean& originalBodyNested, Boolean& prependedDefaultValueTypeConstructorInitializer, InitialState& forSemanticModel) at Microsoft.CodeAnalysis.CSharp.MethodCompiler.CompileMethod(MethodSymbol methodSymbol, Int32 methodOrdinal, ProcessedFieldInitializers& processedInitializers, SynthesizedSubmissionFields previousSubmissionFields, TypeCompilationState compilationState) at Microsoft.CodeAnalysis.CSharp.MethodCompiler.CompileNamedType(NamedTypeSymbol containingType) at Microsoft.CodeAnalysis.CSharp.MethodCompiler.<>c__DisplayClass25_0.b__0() at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) --- End of stack trace from previous location --- at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread) --- End of stack trace from previous location --- at Microsoft.CodeAnalysis.CSharp.MethodCompiler.WaitForWorkers() at Microsoft.CodeAnalysis.CSharp.MethodCompiler.CompileMethodBodies(CSharpCompilation compilation, PEModuleBuilder moduleBeingBuiltOpt, Boolean emittingPdb, Boolean hasDeclarationErrors, Boolean emitMethodBodies, BindingDiagnosticBag diagnostics, Predicate`1 filterOpt, CancellationToken cancellationToken) at Microsoft.CodeAnalysis.CSharp.CSharpCompilation.g__compileMethodBodiesAndDocComments|230_0(SyntaxTree filterTree, Nullable`1 filterSpan, BindingDiagnosticBag bindingDiagnostics, CancellationToken cancellationToken) at Microsoft.CodeAnalysis.CSharp.CSharpCompilation.GetDiagnosticsForMethodBodiesInTree(SyntaxTree tree, Nullable`1 span, CancellationToken cancellationToken) at Microsoft.CodeAnalysis.CSharp.CSharpCompilation.GetDiagnosticsForSyntaxTree(CompilationStage stage, SyntaxTree syntaxTree, Nullable`1 filterSpanWithinTree, Boolean includeEarlierStages, CancellationToken cancellationToken) at Microsoft.CodeAnalysis.CSharp.SyntaxTreeSemanticModel.GetDiagnostics(Nullable`1 span, CancellationToken cancellationToken) at Microsoft.CodeAnalysis.Diagnostics.CompilationWithAnalyzers.g__generateCompilationEvents|64_0(Compilation compilation, AnalysisScope analysisScope, CancellationToken cancellationToken) at Microsoft.CodeAnalysis.Diagnostics.CompilationWithAnalyzers.GetCompilationEventsForSingleFileAnalysis(Compilation compilation, AnalysisScope analysisScope, ImmutableArray`1 additionalFiles, Boolean hasAnyActionsRequiringCompilationEvents, CancellationToken cancellationToken) at Microsoft.CodeAnalysis.Diagnostics.CompilationWithAnalyzers.ComputeAnalyzerDiagnosticsAsync(AnalysisScope analysisScope, CancellationToken cancellationToken) at Microsoft.CodeAnalysis.Diagnostics.CompilationWithAnalyzers.GetAnalysisResultCoreAsync(SemanticModel model, Nullable`1 filterSpan, ImmutableArray`1 analyzers, CancellationToken cancellationToken) at Microsoft.CodeAnalysis.Diagnostics.Extensions.GetAnalysisResultAsync(CompilationWithAnalyzers compilationWithAnalyzers, DocumentAnalysisScope documentAnalysisScope, CancellationToken cancellationToken) at Microsoft.CodeAnalysis.Diagnostics.Extensions.GetAnalysisResultAsync(CompilationWithAnalyzers compilationWithAnalyzers, DocumentAnalysisScope documentAnalysisScope, Project project, DiagnosticAnalyzerInfoCache analyzerInfoCache, CancellationToken cancellationToken) at Microsoft.CodeAnalysis.Remote.Diagnostics.DiagnosticComputer.AnalyzeAsync(CompilationWithAnalyzers compilationWithAnalyzers, BidirectionalMap`2 analyzerToIdMap, ImmutableArray`1 analyzers, SkippedHostAnalyzersInfo skippedAnalyzersInfo, Boolean reportSuppressedDiagnostics, Boolean logPerformanceInfo, Boolean getTelemetryInfo, CancellationToken cancellationToken) at Microsoft.CodeAnalysis.Remote.Diagnostics.DiagnosticComputer.GetDiagnosticsAsync(IEnumerable`1 analyzerIds, Boolean reportSuppressedDiagnostics, Boolean logPerformanceInfo, Boolean getTelemetryInfo, CancellationToken cancellationToken) at Microsoft.CodeAnalysis.Remote.Diagnostics.DiagnosticComputer.GetNormalPriorityDiagnosticsAsync(IEnumerable`1 analyzerIds, Boolean reportSuppressedDiagnostics, Boolean logPerformanceInfo, Boolean getTelemetryInfo, CancellationToken cancellationToken) at Microsoft.CodeAnalysis.Remote.RemoteDiagnosticAnalyzerService.<>c__DisplayClass4_0.<b__0>d.MoveNext() --- End of stack trace from previous location --- at Microsoft.CodeAnalysis.Remote.RemoteWorkspace.<>c__DisplayClass9_0`1.<g__ProcessSolutionAsync|1>d.MoveNext() --- End of stack trace from previous location --- at Microsoft.CodeAnalysis.Remote.RemoteWorkspace.RunWithSolutionAsync[T](AssetProvider assetProvider, Checksum solutionChecksum, Int32 workspaceVersion, Boolean updatePrimaryBranch, Func`2 implementation, CancellationToken cancellationToken) at Microsoft.CodeAnalysis.Remote.RemoteWorkspace.RunWithSolutionAsync[T](AssetProvider assetProvider, Checksum solutionChecksum, Int32 workspaceVersion, Boolean updatePrimaryBranch, Func`2 implementation, CancellationToken cancellationToken) at Microsoft.CodeAnalysis.Remote.BrokeredServiceBase.RunWithSolutionAsync[T](Checksum solutionChecksum, Func`2 implementation, CancellationToken cancellationToken) at Microsoft.CodeAnalysis.Remote.RemoteDiagnosticAnalyzerService.CalculateDiagnosticsAsync(Checksum solutionChecksum, DiagnosticArguments arguments, CancellationToken cancellationToken)
The text was updated successfully, but these errors were encountered:
jjonescz
Successfully merging a pull request may close this issue.
Version Used:
VS 17.10.0 Preview 4.0, assuming most recent roslyn is bundled
Steps to Reproduce:
sharplab
Expected Behavior:
Compilation error(s)
Actual Behavior:
System.Collections.Generic.KeyNotFoundException: The given key 'bar' was not present in the dictionary.
The text was updated successfully, but these errors were encountered: