Open VBAndCs opened 4 years ago
Seems I need to cast the List to array. This works:
Dim y = String.Join($", ", x.ToArray, 1, x.Count - 1)
But there is still a a crash to fix :)
I dont think there's an overload resolution bug - the overload you want is:
Join(String, String[], Int32, Int32)
but that accepts an array not a list.
Perhaps close this issue and open a new one for the crash so it is clearer what the issue is?
@YairHalberstadt
There is still an issue here:
When I used:
Dim y = String.Join(separator:=$", ", value:=x, startIndex:=1, count:=x.Count - 1)
The right error message to give is:
List(Of string) can't converted directly to String(). Are you missing a cast?
This sort of long misleading overload resolution failure message wastes me some time every time. After all, there is no resolution in this named argument situation. It is a direct call.
The current error message is:
error BC30518: Overload resolution failed because no accessible 'Join' can be called with these arguments:
'Public Shared Overloads Function Join(separator As Char, ParamArray value As String()) As String': Named argument cannot match a ParamArray parameter.
'Public Shared Overloads Function Join(separator As Char, ParamArray value As String()) As String': 'startIndex' is not a method parameter.
'Public Shared Overloads Function Join(separator As Char, ParamArray value As String()) As String': 'count' is not a method parameter.
'Public Shared Overloads Function Join(separator As Char, ParamArray values As Object()) As String': 'value' is not a method parameter.
'Public Shared Overloads Function Join(separator As Char, ParamArray values As Object()) As String': 'startIndex' is not a method parameter.
'Public Shared Overloads Function Join(separator As Char, ParamArray values As Object()) As String': 'count' is not a method parameter.
'Public Shared Overloads Function Join(separator As Char, value As String(), startIndex As Integer, count As Integer) As String': Value of type 'List(Of String)' cannot be converted to 'String()'.
'Public Shared Overloads Function Join(separator As String, ParamArray value As String()) As String': Named argument cannot match a ParamArray parameter.
'Public Shared Overloads Function Join(separator As String, ParamArray value As String()) As String': 'startIndex' is not a method parameter.
'Public Shared Overloads Function Join(separator As String, ParamArray value As String()) As String': 'count' is not a method parameter.
'Public Shared Overloads Function Join(separator As String, ParamArray values As Object()) As String': 'value' is not a method parameter.
'Public Shared Overloads Function Join(separator As String, ParamArray values As Object()) As String': 'startIndex' is not a method parameter.
'Public Shared Overloads Function Join(separator As String, ParamArray values As Object()) As String': 'count' is not a method parameter.
'Public Shared Overloads Function Join(separator As String, value As String(), startIndex As Integer, count As Integer) As String': Value of type 'List(Of String)' cannot be converted to 'String()'.
Note the final line 'Public Shared Overloads Function Join(separator As String, value As String(), startIndex As Integer, count As Integer) As String': Value of type 'List(Of String)' cannot be converted to 'String()'.
is the error message you desire.
If you would like the error message to just contain that line, I would suggest opening a new issue for that.
@YairHalberstadt OK. I will edit this issue to only focus on the crash.
The new issue: https://github.com/dotnet/roslyn/issues/42938
Crash stack:
"type": "System.IndexOutOfRangeException",
"message": "Index was outside the bounds of the array.",
"stack": "
at System.Collections.Immutable.ImmutableArray`1.get_Item(Int32 index)\r
at Microsoft.CodeAnalysis.VisualBasic.Binder.ReportOverloadResolutionFailureForASingleCandidate(SyntaxNode node, Location diagnosticLocation, LookupResultKind lookupResult, CandidateAnalysisResult& candidateAnalysisResult, ImmutableArray`1 arguments, ImmutableArray`1 argumentNames, Boolean allowUnexpandedParamArrayForm, Boolean allowExpandedParamArrayForm, Boolean includeMethodNameInErrorMessages, Boolean reportNarrowingConversions, DiagnosticBag diagnostics, Symbol delegateSymbol, Boolean queryMode, SyntaxNode callerInfoOpt, Symbol representCandidateInDiagnosticsOpt) in C:\\github\\roslyn\\src\\Compilers\\VisualBasic\\Portable\\Binding\\Binder_Invocation.vb:line 2128\r
at Microsoft.CodeAnalysis.VisualBasic.Binder.ReportOverloadResolutionFailureForASetOfCandidates(SyntaxNode node, Location diagnosticLocation, LookupResultKind lookupResult, ERRID errorNo, ArrayBuilder`1 candidates, ImmutableArray`1 arguments, ImmutableArray`1 argumentNames, DiagnosticBag diagnostics, Symbol delegateSymbol, Boolean queryMode, SyntaxNode callerInfoOpt) in C:\\github\\roslyn\\src\\Compilers\\VisualBasic\\Portable\\Binding\\Binder_Invocation.vb:line 1867\r
at Microsoft.CodeAnalysis.VisualBasic.Binder.ReportOverloadResolutionFailureAndProduceBoundNode(SyntaxNode node, LookupResultKind lookupResult, ArrayBuilder`1 bestCandidates, ImmutableArray`1 bestSymbols, TypeSymbol commonReturnType, ImmutableArray`1 boundArguments, ImmutableArray`1 argumentNames, DiagnosticBag diagnostics, SyntaxNode callerInfoOpt, BoundMethodOrPropertyGroup groupOpt, Symbol delegateSymbol, Boolean queryMode, BoundTypeExpression boundTypeExpression, Symbol representCandidateInDiagnosticsOpt, Location diagnosticLocationOpt) in C:\\github\\roslyn\\src\\Compilers\\VisualBasic\\Portable\\Binding\\Binder_Invocation.vb:line 1553\r
at Microsoft.CodeAnalysis.VisualBasic.Binder.ReportOverloadResolutionFailureAndProduceBoundNode(SyntaxNode node, LookupResultKind lookupResult, ImmutableArray`1 boundArguments, ImmutableArray`1 argumentNames, OverloadResolutionResult& results, DiagnosticBag diagnostics, SyntaxNode callerInfoOpt, BoundMethodOrPropertyGroup groupOpt, TypeSymbol overrideCommonReturnType, Boolean queryMode, BoundTypeExpression boundTypeExpression, Symbol representCandidateInDiagnosticsOpt, Location diagnosticLocationOpt) in C:\\github\\roslyn\\src\\Compilers\\VisualBasic\\Portable\\Binding\\Binder_Invocation.vb:line 1245\r
at Microsoft.CodeAnalysis.VisualBasic.Binder.ReportOverloadResolutionFailureAndProduceBoundNode(SyntaxNode node, BoundMethodOrPropertyGroup group, ImmutableArray`1 boundArguments, ImmutableArray`1 argumentNames, OverloadResolutionResult& results, DiagnosticBag diagnostics, SyntaxNode callerInfoOpt, TypeSymbol overrideCommonReturnType, Boolean queryMode, BoundTypeExpression boundTypeExpression, Symbol representCandidateInDiagnosticsOpt, Location diagnosticLocationOpt) in C:\\github\\roslyn\\src\\Compilers\\VisualBasic\\Portable\\Binding\\Binder_Invocation.vb:line 1204\r
at Microsoft.CodeAnalysis.VisualBasic.Binder.BindInvocationExpression(SyntaxNode node, SyntaxNode target, TypeCharacter typeChar, BoundMethodOrPropertyGroup group, ImmutableArray`1 boundArguments, ImmutableArray`1 argumentNames, DiagnosticBag diagnostics, SyntaxNode callerInfoOpt, Boolean allowConstructorCall, Boolean suppressAbstractCallDiagnostics, Boolean isDefaultMemberAccess, Symbol representCandidateInDiagnosticsOpt, Boolean forceExpandedForm) in C:\\github\\roslyn\\src\\Compilers\\VisualBasic\\Portable\\Binding\\Binder_Invocation.vb:line 805\r
at Microsoft.CodeAnalysis.VisualBasic.Binder.BindInvocationExpressionPossiblyWithoutArguments(InvocationExpressionSyntax node, TypeCharacter typeChar, BoundMethodOrPropertyGroup group, ImmutableArray`1 boundArguments, ImmutableArray`1 argumentNames, ImmutableArray`1 argumentNamesLocations, Boolean allowBindingWithoutArguments, DiagnosticBag diagnostics) in C:\\github\\roslyn\\src\\Compilers\\VisualBasic\\Portable\\Binding\\Binder_Invocation.vb:line 502\r
at Microsoft.CodeAnalysis.VisualBasic.Binder.BindInvocationExpression(InvocationExpressionSyntax node, DiagnosticBag diagnostics) in C:\\github\\roslyn\\src\\Compilers\\VisualBasic\\Portable\\Binding\\Binder_Invocation.vb:line 194\r
at Microsoft.CodeAnalysis.VisualBasic.Binder.BindExpression(ExpressionSyntax node, Boolean isInvocationOrAddressOf, Boolean isOperandOfConditionalBranch, Boolean eventContext, DiagnosticBag diagnostics) in C:\\github\\roslyn\\src\\Compilers\\VisualBasic\\Portable\\Binding\\Binder_Expressions.vb:line 68\r
at Microsoft.CodeAnalysis.VisualBasic.Binder.BindValue(ExpressionSyntax node, DiagnosticBag diagnostics, Boolean isOperandOfConditionalBranch) in C:\\github\\roslyn\\src\\Compilers\\VisualBasic\\Portable\\Binding\\Binder_Expressions.vb:line 806\r
at Microsoft.CodeAnalysis.VisualBasic.Binder.ComputeVariableType(LocalSymbol symbol, ModifiedIdentifierSyntax modifiedIdentifierOpt, AsClauseSyntax asClauseOpt, EqualsValueSyntax equalsValueOpt, BoundExpression& valueExpression, TypeSymbol& asClauseType, DiagnosticBag diagnostics) in C:\\github\\roslyn\\src\\Compilers\\VisualBasic\\Portable\\Binding\\Binder_Statements.vb:line 1351\r
at Microsoft.CodeAnalysis.VisualBasic.Binder.BindVariableDeclaration(VisualBasicSyntaxNode tree, ModifiedIdentifierSyntax name, AsClauseSyntax asClauseOpt, EqualsValueSyntax equalsValueOpt, DiagnosticBag diagnostics, Boolean skipAsNewInitializer) in C:\\github\\roslyn\\src\\Compilers\\VisualBasic\\Portable\\Binding\\Binder_Statements.vb:line 1110\r
at Microsoft.CodeAnalysis.VisualBasic.Binder.BindVariableDeclarators(SeparatedSyntaxList`1 declarators, DiagnosticBag diagnostics) in C:\\github\\roslyn\\src\\Compilers\\VisualBasic\\Portable\\Binding\\Binder_Statements.vb:line 1018\r
at Microsoft.CodeAnalysis.VisualBasic.Binder.BindLocalDeclaration(LocalDeclarationStatementSyntax node, DiagnosticBag diagnostics) in C:\\github\\roslyn\\src\\Compilers\\VisualBasic\\Portable\\Binding\\Binder_Statements.vb:line 986\r
at Microsoft.CodeAnalysis.VisualBasic.Binder.BindStatement(StatementSyntax node, DiagnosticBag diagnostics) in C:\\github\\roslyn\\src\\Compilers\\VisualBasic\\Portable\\Binding\\Binder_Statements.vb:line 81\r
at Microsoft.CodeAnalysis.VisualBasic.MemberSemanticModel.IncrementalBinder.BindStatement(StatementSyntax node, DiagnosticBag diagnostics) in C:\\github\\roslyn\\src\\Compilers\\VisualBasic\\Portable\\Binding\\MemberSemanticModel.vb:line 2077\r
at Microsoft.CodeAnalysis.VisualBasic.VBSemanticModel.Bind(Binder binder, SyntaxNode node, DiagnosticBag diagnostics) in C:\\github\\roslyn\\src\\Compilers\\VisualBasic\\Portable\\Compilation\\SemanticModel.vb:line 1576\r
at Microsoft.CodeAnalysis.VisualBasic.MemberSemanticModel.GuardedIncrementalBind(SyntaxNode bindingRoot, Binder enclosingBinder) in C:\\github\\roslyn\\src\\Compilers\\VisualBasic\\Portable\\Binding\\MemberSemanticModel.vb:line 1951\r
at Microsoft.CodeAnalysis.VisualBasic.MemberSemanticModel.GetBoundNodes(SyntaxNode node) in C:\\github\\roslyn\\src\\Compilers\\VisualBasic\\Portable\\Binding\\MemberSemanticModel.vb:line 1871\r
at Microsoft.CodeAnalysis.VisualBasic.MemberSemanticModel.GetUpperBoundNode(SyntaxNode node) in C:\\github\\roslyn\\src\\Compilers\\VisualBasic\\Portable\\Binding\\MemberSemanticModel.vb:line 169\r
at Microsoft.CodeAnalysis.VisualBasic.MemberSemanticModel.GetBoundNodeSummary(VisualBasicSyntaxNode node) in C:\\github\\roslyn\\src\\Compilers\\VisualBasic\\Portable\\Binding\\MemberSemanticModel.vb:line 227\r
at Microsoft.CodeAnalysis.VisualBasic.MemberSemanticModel.GetExpressionSymbolInfo(ExpressionSyntax node, SymbolInfoOptions options, CancellationToken cancellationToken) in C:\\github\\roslyn\\src\\Compilers\\VisualBasic\\Portable\\Binding\\MemberSemanticModel.vb:line 849\r
at Microsoft.CodeAnalysis.VisualBasic.SyntaxTreeSemanticModel.GetExpressionSymbolInfo(ExpressionSyntax node, SymbolInfoOptions options, CancellationToken cancellationToken) in C:\\github\\roslyn\\src\\Compilers\\VisualBasic\\Portable\\Compilation\\SyntaxTreeSemanticModel.vb:line 213\r
at Microsoft.CodeAnalysis.VisualBasic.VBSemanticModel.GetSymbolInfo(ExpressionSyntax expression, CancellationToken cancellationToken) in C:\\github\\roslyn\\src\\Compilers\\VisualBasic\\Portable\\Compilation\\SemanticModel.vb:line 167\r
at Microsoft.CodeAnalysis.VisualBasic.VBSemanticModel.GetSymbolInfoForNode(SyntaxNode node, CancellationToken cancellationToken) in C:\\github\\roslyn\\src\\Compilers\\VisualBasic\\Portable\\Compilation\\SemanticModel.vb:line 3076\r
at Microsoft.CodeAnalysis.VisualBasic.VBSemanticModel.GetSymbolInfoCore(SyntaxNode node, CancellationToken cancellationToken) in C:\\github\\roslyn\\src\\Compilers\\VisualBasic\\Portable\\Compilation\\SemanticModel.vb:line 3167\r
at Microsoft.CodeAnalysis.SemanticModel.GetSymbolInfo(SyntaxNode node, CancellationToken cancellationToken) in C:\\github\\roslyn\\src\\Compilers\\Core\\Portable\\Compilation\\SemanticModel.cs:line 112\r
at Microsoft.CodeAnalysis.ModelExtensions.GetSymbolInfo(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken) in C:\\github\\roslyn\\src\\Compilers\\Core\\Portable\\Compilation\\Extensions.cs:line 28\r
at Microsoft.CodeAnalysis.VisualBasic.Classification.Classifiers.OperatorOverloadSyntaxClassifier.AddClassifications(Workspace workspace, SyntaxNode syntax, SemanticModel semanticModel, ArrayBuilder`1 result, CancellationToken cancellationToken) in C:\\github\\roslyn\\src\\Workspaces\\VisualBasic\\Portable\\Classification\\SyntaxClassification\\OperatorOverloadSyntaxClassifier.vb:line 28\r
at Microsoft.CodeAnalysis.Classification.AbstractSyntaxClassificationService.Worker.ClassifyNode(SyntaxNode syntax) in C:\\github\\roslyn\\src\\Workspaces\\Core\\Portable\\Classification\\SyntaxClassification\\AbstractSyntaxClassificationService.Worker.cs:line 133\r
at Microsoft.CodeAnalysis.Classification.AbstractSyntaxClassificationService.Worker.ClassifyNodeOrToken(SyntaxNodeOrToken nodeOrToken) in C:\\github\\roslyn\\src\\Workspaces\\Core\\Portable\\Classification\\SyntaxClassification\\AbstractSyntaxClassificationService.Worker.cs:line 116\r
at Microsoft.CodeAnalysis.Classification.AbstractSyntaxClassificationService.Worker.ProcessNodes() in C:\\github\\roslyn\\src\\Workspaces\\Core\\Portable\\Classification\\SyntaxClassification\\AbstractSyntaxClassificationService.Worker.cs:line 101\r
at Microsoft.CodeAnalysis.Classification.AbstractSyntaxClassificationService.Worker.Classify(Workspace workspace, SemanticModel semanticModel, TextSpan textSpan, ArrayBuilder`1 list, Func`2 getNodeClassifiers, Func`2 getTokenClassifiers, CancellationToken cancellationToken) in C:\\github\\roslyn\\src\\Workspaces\\Core\\Portable\\Classification\\SyntaxClassification\\AbstractSyntaxClassificationService.Worker.cs:line 69\r
at Microsoft.CodeAnalysis.Classification.AbstractSyntaxClassificationService.AddSemanticClassifications(SemanticModel semanticModel, TextSpan textSpan, Workspace workspace, Func`2 getNodeClassifiers, Func`2 getTokenClassifiers, ArrayBuilder`1 result, CancellationToken cancellationToken) in C:\\github\\roslyn\\src\\Workspaces\\Core\\Portable\\Classification\\SyntaxClassification\\AbstractSyntaxClassificationService.cs:line 56\r
at Microsoft.CodeAnalysis.Classification.AbstractSyntaxClassificationService.<AddSemanticClassificationsAsync>d__5.MoveNext() in C:\\github\\roslyn\\src\\Workspaces\\Core\\Portable\\Classification\\SyntaxClassification\\AbstractSyntaxClassificationService.cs:line 41\r
--- End of stack trace from previous location where exception was thrown ---\r
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable.ConfiguredTaskAwaiter.GetResult()\r
at Microsoft.CodeAnalysis.Classification.AbstractClassificationService.<AddSemanticClassificationsInCurrentProcessAsync>d__4.MoveNext() in C:\\github\\roslyn\\src\\Workspaces\\Core\\Portable\\Classification\\AbstractClassificationService.cs:line 91\r
--- End of stack trace from previous location where exception was thrown ---\r
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable.ConfiguredTaskAwaiter.GetResult()\r
at Microsoft.CodeAnalysis.Remote.CodeAnalysisService.<>c__DisplayClass17_0.<<GetSemanticClassificationsAsync>b__0>d.MoveNext() in C:\\github\\roslyn\\src\\Workspaces\\Remote\\ServiceHub\\Services\\CodeAnalysisService_SemanticClassification.cs:line 28\r
--- End of stack trace from previous location where exception was thrown ---\r
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()\r
at Microsoft.CodeAnalysis.Remote.ServiceBase.<RunServiceAsync>d__13`1.MoveNext() in C:\\github\\roslyn\\src\\Workspaces\\Remote\\ServiceHub\\Shared\\ServiceBase.cs:line 91",
"code": -2146233080,
Tagging @jcouv since this is a crash in the compiler.
@VBAndCs
Dim x As New List(Of String) From {"a", "b", "c"} Dim y = String.Join($", ", x, 1, x.Count - 1)
This may not fit your use case, but...
Dim y = String.Join(", ", {"a", "b", "c"}, 1, 2)
Or
Dim y = String.Join(", ", x.Skip(1))
Seems like what you should be doing...
I think before fixing this bug in the compiler, you need to send it to Visual studio to prevent the crash when the compiler throws an exception, as this can happen with other sorts of bugs in compilers. A sudden close of VS.NET can make us loose some valuable unsaved changes.
I hit this crash in the latest VS IntPreview dogfood build while working on Roslyn.sln. Goldbar shows the following exception stack trace:
StreamJsonRpc.RemoteInvocationException: Index was outside the bounds of the array.
at StreamJsonRpc.JsonRpc.<InvokeCoreAsync>d__151`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.<TryInvokeAsync>d__18`1.MoveNext()
RPC server exception:
System.IndexOutOfRangeException: Index was outside the bounds of the array.
at Microsoft.CodeAnalysis.VisualBasic.Binder.ReportOverloadResolutionFailureForASingleCandidate(SyntaxNode node, Location diagnosticLocation, LookupResultKind lookupResult, CandidateAnalysisResult& candidateAnalysisResult, ImmutableArray`1 arguments, ImmutableArray`1 argumentNames, Boolean allowUnexpandedParamArrayForm, Boolean allowExpandedParamArrayForm, Boolean includeMethodNameInErrorMessages, Boolean reportNarrowingConversions, BindingDiagnosticBag diagnostics, Symbol delegateSymbol, Boolean queryMode, SyntaxNode callerInfoOpt, Symbol representCandidateInDiagnosticsOpt)
at Microsoft.CodeAnalysis.VisualBasic.Binder.ReportOverloadResolutionFailureForASetOfCandidates(SyntaxNode node, Location diagnosticLocation, LookupResultKind lookupResult, ERRID errorNo, ArrayBuilder`1 candidates, ImmutableArray`1 arguments, ImmutableArray`1 argumentNames, BindingDiagnosticBag diagnostics, Symbol delegateSymbol, Boolean queryMode, SyntaxNode callerInfoOpt)
at Microsoft.CodeAnalysis.VisualBasic.Binder.ReportOverloadResolutionFailureAndProduceBoundNode(SyntaxNode node, LookupResultKind lookupResult, ArrayBuilder`1 bestCandidates, ImmutableArray`1 bestSymbols, TypeSymbol commonReturnType, ImmutableArray`1 boundArguments, ImmutableArray`1 argumentNames, BindingDiagnosticBag diagnostics, SyntaxNode callerInfoOpt, BoundMethodOrPropertyGroup groupOpt, Symbol delegateSymbol, Boolean queryMode, BoundTypeExpression boundTypeExpression, Symbol representCandidateInDiagnosticsOpt, Location diagnosticLocationOpt)
at Microsoft.CodeAnalysis.VisualBasic.Binder.ReportOverloadResolutionFailureAndProduceBoundNode(SyntaxNode node, LookupResultKind lookupResult, ImmutableArray`1 boundArguments, ImmutableArray`1 argumentNames, OverloadResolutionResult& results, BindingDiagnosticBag diagnostics, SyntaxNode callerInfoOpt, BoundMethodOrPropertyGroup groupOpt, TypeSymbol overrideCommonReturnType, Boolean queryMode, BoundTypeExpression boundTypeExpression, Symbol representCandidateInDiagnosticsOpt, Location diagnosticLocationOpt)
at Microsoft.CodeAnalysis.VisualBasic.Binder.BindInvocationExpression(SyntaxNode node, SyntaxNode target, TypeCharacter typeChar, BoundMethodOrPropertyGroup group, ImmutableArray`1 boundArguments, ImmutableArray`1 argumentNames, BindingDiagnosticBag diagnostics, SyntaxNode callerInfoOpt, Boolean allowConstructorCall, Boolean suppressAbstractCallDiagnostics, Boolean isDefaultMemberAccess, Symbol representCandidateInDiagnosticsOpt, Boolean forceExpandedForm)
at Microsoft.CodeAnalysis.VisualBasic.Binder.BindInvocationExpressionPossiblyWithoutArguments(InvocationExpressionSyntax node, TypeCharacter typeChar, BoundMethodOrPropertyGroup group, ImmutableArray`1 boundArguments, ImmutableArray`1 argumentNames, ImmutableArray`1 argumentNamesLocations, Boolean allowBindingWithoutArguments, BindingDiagnosticBag diagnostics)
at Microsoft.CodeAnalysis.VisualBasic.Binder.BindInvocationExpression(InvocationExpressionSyntax node, BindingDiagnosticBag diagnostics)
at Microsoft.CodeAnalysis.VisualBasic.Binder.BindExpression(ExpressionSyntax node, Boolean isInvocationOrAddressOf, Boolean isOperandOfConditionalBranch, Boolean eventContext, BindingDiagnosticBag diagnostics)
at Microsoft.CodeAnalysis.VisualBasic.Binder.BindReturn(ReturnStatementSyntax originalSyntax, BindingDiagnosticBag diagnostics)
at Microsoft.CodeAnalysis.VisualBasic.Binder.BindStatement(StatementSyntax node, BindingDiagnosticBag diagnostics)
at Microsoft.CodeAnalysis.VisualBasic.Binder.BindBlock(SyntaxNode syntax, SyntaxList`1 stmtList, BindingDiagnosticBag diagnostics, Binder stmtListBinder)
at Microsoft.CodeAnalysis.VisualBasic.Binder.BindMethodBlock(MethodBlockBaseSyntax methodBlock, BindingDiagnosticBag diagnostics)
at Microsoft.CodeAnalysis.VisualBasic.Binder.BindStatement(StatementSyntax node, BindingDiagnosticBag diagnostics)
at Microsoft.CodeAnalysis.VisualBasic.Symbols.SourceMethodSymbol.GetBoundMethodBody(TypeCompilationState compilationState, BindingDiagnosticBag diagnostics, Binder& methodBodyBinder)
at Microsoft.CodeAnalysis.VisualBasic.MethodCompiler.BindAndAnalyzeMethodBody(MethodSymbol method, TypeCompilationState compilationState, BindingDiagnosticBag diagnostics, Binder containingTypeBinder, MethodSymbol& referencedConstructor, Boolean& injectDefaultConstructorCall, Binder& methodBodyBinder)
at Microsoft.CodeAnalysis.VisualBasic.MethodCompiler.CompileMethod(MethodSymbol method, Int32 methodOrdinal, Int32& withEventPropertyIdDispenser, Int32& delegateRelaxationIdDispenser, Predicate`1 filter, TypeCompilationState compilationState, ProcessedFieldOrPropertyInitializers processedInitializers, Binder containingTypeBinder, SynthesizedSubmissionFields previousSubmissionFields, MethodSymbol& referencedConstructor)
at Microsoft.CodeAnalysis.VisualBasic.MethodCompiler.CompileNamedType(NamedTypeSymbol containingType, Predicate`1 filter)
at Microsoft.CodeAnalysis.VisualBasic.MethodCompiler._Closure$__33-0._Lambda$__0()
at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, 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.VisualBasic.MethodCompiler.WaitForWorkers()
at Microsoft.CodeAnalysis.VisualBasic.VisualBasicCompilation.GetDiagnosticsForAllMethodBodies(Boolean hasDeclarationErrors, BindingDiagnosticBag diagnostics, Boolean doLowering, CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.VisualBasic.VisualBasicCompilation.GetDiagnosticsWithoutFiltering(CompilationStage stage, Boolean includeEarlierStages, BindingDiagnosticBag builder, CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.VisualBasic.VisualBasicCompilation.GetDiagnostics(CompilationStage stage, Boolean includeEarlierStages, DiagnosticBag diagnostics, CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.VisualBasic.VisualBasicCompilation.GetDiagnostics(CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.Diagnostics.CompilationWithAnalyzers.ComputeAnalyzerDiagnosticsAsync(AnalysisScope analysisScope, CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.Diagnostics.CompilationWithAnalyzers.GetAnalysisResultCoreAsync(ImmutableArray`1 analyzers, CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.Diagnostics.CompilationWithAnalyzers.GetAnalysisResultAsync(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.<<CalculateDiagnosticsAsync>b__0>d.MoveNext()
--- End of stack trace from previous location ---
When I was working with
String.Join
:I missed a cast, so I got the wrong overload, So, I tried to use named arguments to get the overload I want, so I added
StartIndex:=
in the third param:Dim y = String.Join($", ", x, StartIndex:= 1, x.Count - 1)
But this crashes VS immediately. This happens when choosing the named param from the auto completion list, hand-write it, or even paste it. This happens with me repeatedly on Community Edition 16.5.1, on Win 7 32 bit and on Win 10 64 bit.