diff --git a/build/Targets/Packages.props b/build/Targets/Packages.props index ded34fefaae164b1f8d68155fb1837c9f4155503..555699313e810b8589cd16a39df4d2a8a9fea8cd 100644 --- a/build/Targets/Packages.props +++ b/build/Targets/Packages.props @@ -139,7 +139,7 @@ 105.2.3 0.9.8-beta 14.0.983-pre-ge167e81694 - 2.3.0-beta3-61801-06 + 2.6.0-beta1-62010-04 0.2.4-beta 0.3.0-beta 0.4.0-beta diff --git a/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenDeconstructTests.cs b/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenDeconstructTests.cs index 7b7eb6dd69aa477dd5a65be946949edf6648e7a1..f08b0a714a17efbe00abd39d6e1aea6b88623de6 100644 --- a/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenDeconstructTests.cs +++ b/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenDeconstructTests.cs @@ -7703,6 +7703,34 @@ static void Main() CompileAndVerify(comp, expectedOutput: "once"); } + [WorkItem(21028, "https://github.com/dotnet/roslyn/issues/21028")] + [Fact] + public void InferredName() + { + var source = +@"class C +{ + static void Main() + { + int x = 0, y = 1; + var t = (x, y); + var (a, b) = t; + } +}"; + // C# 7.0 + var comp = CreateStandardCompilation( + source, + parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7), + references: new[] { ValueTupleRef, SystemRuntimeFacadeRef }); + comp.VerifyEmitDiagnostics(); + // C# 7.1 + comp = CreateStandardCompilation( + source, + parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1), + references: new[] { ValueTupleRef, SystemRuntimeFacadeRef }); + comp.VerifyEmitDiagnostics(); + } + [WorkItem(21028, "https://github.com/dotnet/roslyn/issues/21028")] [Fact] public void InferredName_ConditionalOperator() diff --git a/src/VisualStudio/Core/Def/Implementation/TaskList/ExternalErrorDiagnosticUpdateSource.cs b/src/VisualStudio/Core/Def/Implementation/TaskList/ExternalErrorDiagnosticUpdateSource.cs index e5646a59c81be9b5152c4884d7b1a633848d0900..e4091aa6fbbe84e5b0cccac66d878e056e1f4244 100644 --- a/src/VisualStudio/Core/Def/Implementation/TaskList/ExternalErrorDiagnosticUpdateSource.cs +++ b/src/VisualStudio/Core/Def/Implementation/TaskList/ExternalErrorDiagnosticUpdateSource.cs @@ -418,26 +418,29 @@ public void Done() public bool SupportedDiagnosticId(ProjectId projectId, string id) { - if (_diagnosticIdMap.TryGetValue(projectId, out var ids)) + lock (_diagnosticIdMap) { - return ids.Contains(id); - } + if (_diagnosticIdMap.TryGetValue(projectId, out var ids)) + { + return ids.Contains(id); + } - // set ids set - var map = new HashSet(); - _diagnosticIdMap.Add(projectId, map); + // set ids set + var map = new HashSet(); + _diagnosticIdMap.Add(projectId, map); - var project = _solution.GetProject(projectId); - if (project == null) - { - // projectId no longer exist, return false; - return false; - } + var project = _solution.GetProject(projectId); + if (project == null) + { + // projectId no longer exist, return false; + return false; + } - var descriptorMap = _owner._diagnosticService.GetDiagnosticDescriptors(project); - map.UnionWith(descriptorMap.Values.SelectMany(v => v.Select(d => d.Id))); + var descriptorMap = _owner._diagnosticService.GetDiagnosticDescriptors(project); + map.UnionWith(descriptorMap.Values.SelectMany(v => v.Select(d => d.Id))); - return map.Contains(id); + return map.Contains(id); + } } public ImmutableArray GetBuildDiagnostics() diff --git a/src/VisualStudio/Core/Test/Diagnostics/ExternalDiagnosticUpdateSourceTests.vb b/src/VisualStudio/Core/Test/Diagnostics/ExternalDiagnosticUpdateSourceTests.vb index 9a62376bd18b8a488b5b623dafe293eeee54e2da..a05bd29372ac1860de28f583a56e7544d0155fec 100644 --- a/src/VisualStudio/Core/Test/Diagnostics/ExternalDiagnosticUpdateSourceTests.vb +++ b/src/VisualStudio/Core/Test/Diagnostics/ExternalDiagnosticUpdateSourceTests.vb @@ -68,6 +68,20 @@ Namespace Microsoft.VisualStudio.LanguageServices.UnitTests.Diagnostics End Using End Sub + + Public Sub TestExternalDiagnostics_SupportedDiagnosticId_Concurrent() + Using workspace = TestWorkspace.CreateCSharp(String.Empty) + Dim waiter = New Waiter() + Dim service = New TestDiagnosticAnalyzerService() + Dim source = New ExternalErrorDiagnosticUpdateSource(workspace, service, New MockDiagnosticUpdateSourceRegistrationService(), waiter) + + Dim project = workspace.CurrentSolution.Projects.First() + source.OnSolutionBuild(Me, Shell.UIContextChangedEventArgs.From(True)) + + Parallel.For(0, 100, Sub(i As Integer) source.SupportedDiagnosticId(project.Id, "CS1002")) + End Using + End Sub + Public Async Function TestExternalDiagnostics_DuplicatedError() As Task Using workspace = TestWorkspace.CreateCSharp(String.Empty)