Skip to content

Commit 7d3fbf2

Browse files
author
Neal Gafter
committed
Merge branch 'master' of https://github.com/dotnet/roslyn into annotate-local-lowering
2 parents 097045a + b28f5fe commit 7d3fbf2

515 files changed

Lines changed: 10827 additions & 3762 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

NuGet.config

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,22 @@
55
<clear />
66
<add key="dotnet-core" value="https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json" />
77
<add key="dotnet-eng" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json" />
8+
<add key="dotnet-tools" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json" />
9+
<add key="dotnet5" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json" />
810
<add key="system-commandline" value="https://dotnet.myget.org/F/system-commandline/api/v3/index.json" />
911
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
1012
<add key="myget-dotnet-coreclr" value="https://dotnet.myget.org/F/dotnet-coreclr/api/v3/index.json" />
1113
<add key="myget-dotnet-core" value="https://dotnet.myget.org/F/dotnet-core/api/v3/index.json" />
1214
<add key="dotnet-corefxtestdata" value="https://dotnet.myget.org/F/dotnet-corefxtestdata/api/v3/index.json" />
1315
<add key="dotnet-buildtools" value="https://dotnet.myget.org/F/dotnet-buildtools/api/v3/index.json" />
1416
<add key="experimental-vs-packages" value="https://dotnet.myget.org/F/experimental-vs-packages/api/v3/index.json" />
15-
<add key="symreader" value="https://dotnet.myget.org/F/symreader/api/v3/index.json" />
16-
<add key="symreader-portable" value="https://dotnet.myget.org/F/symreader-portable/api/v3/index.json" />
17-
<add key="symreader-converter" value="https://dotnet.myget.org/F/symreader-converter/api/v3/index.json" />
1817
<add key="symreader-native" value="https://dotnet.myget.org/F/symreader-native/api/v3/index.json" />
1918
<add key="metadata-tools" value="https://dotnet.myget.org/F/metadata-tools/api/v3/index.json" />
2019
<add key="interactive-window" value="https://dotnet.myget.org/F/interactive-window/api/v3/index.json" />
2120
<add key="roslyn-master-nightly" value="https://dotnet.myget.org/F/roslyn-master-nightly/api/v3/index.json" />
2221
<add key="roslyn-tools" value="https://dotnet.myget.org/F/roslyn-tools/api/v3/index.json" />
2322
<add key="roslyn-analyzers" value="https://dotnet.myget.org/F/roslyn-analyzers/api/v3/index.json" />
2423
<add key="roslyn" value="https://dotnet.myget.org/F/roslyn/api/v3/index.json" />
25-
<add key="sourcelink" value="https://dotnet.myget.org/F/sourcelink/api/v3/index.json" />
2624
<add key="vs-devcore" value="https://myget.org/F/vs-devcore/api/v3/index.json" />
2725
<add key="vs-editor" value="https://myget.org/F/vs-editor/api/v3/index.json" />
2826
<add key="roslyn_concord" value="https://myget.org/F/roslyn_concord/api/v3/index.json" />

azure-pipelines.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ jobs:
229229

230230
- job: macOS_Test
231231
pool:
232-
vmImage: 'macOS-10.13'
232+
vmImage: 'macOS-10.14'
233233
timeoutInMinutes: 90
234234

235235
steps:

docs/Language Feature Status.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ efforts behind them.
2121
| [Native ints](https://github.com/dotnet/csharplang/issues/435) | [features/NativeInt](https://github.com/dotnet/roslyn/tree/features/NativeInt) | [In Progress](https://github.com/dotnet/roslyn/issues/38821) | [cston](https://github.com/cston) | [333fred](https://github.com/333fred), [gafter](https://github.com/gafter) | [jaredpar](https://github.com/jaredpar) |
2222
| [Attributes on local functions](https://github.com/dotnet/csharplang/issues/1888) | [features/local-function-attributes](https://github.com/dotnet/roslyn/tree/features/local-function-attributes) | [Merged](https://github.com/dotnet/roslyn/issues/38801) | [RikkiGibson](https://github.com/RikkiGibson) | [agocke](https://github.com/agocke) | [agocke](https://github.com/agocke) |
2323
| [Function pointers](https://github.com/dotnet/csharplang/issues/191) | [function-pointers](https://github.com/dotnet/roslyn/tree/features/function-pointers) | [In Progress](https://github.com/dotnet/roslyn/issues/38830) | [333fred](https://github.com/333fred) | [AlekseyTs](https://github.com/AlekseyTs) | [jaredpar](https://github.com/jaredpar) |
24-
| [Pattern matching improvements](https://github.com/dotnet/csharplang/issues/2850) | [features/patterns3](https://github.com/dotnet/roslyn/tree/features/patterns3) | In progress | [gafter](https://github.com/gafter) | [RikkiGibson](https://github.com/RikkiGibson),[agocke](https://github.com/agocke) | [gafter](https://github.com/gafter) |
24+
| [Pattern matching improvements](https://github.com/dotnet/csharplang/issues/2850) | [features/patterns3](https://github.com/dotnet/roslyn/tree/features/patterns3) | [In progress](https://github.com/dotnet/roslyn/issues/41502) ([test](https://github.com/dotnet/roslyn/issues/40727)) | [gafter](https://github.com/gafter) | [RikkiGibson](https://github.com/RikkiGibson),[agocke](https://github.com/agocke) | [gafter](https://github.com/gafter) |
2525
| [Static lambdas](https://github.com/dotnet/csharplang/issues/275) | [features/static-lambdas](https://github.com/dotnet/roslyn/tree/features/static-lambdas) | [In progress](https://github.com/dotnet/roslyn/issues/39606) | [CyrusNajmabadi](https://github.com/CyrusNajmabadi) | [jcouv](https://github.com/jcouv) | [jcouv](https://github.com/jcouv) |
26-
| [Records](https://github.com/dotnet/csharplang/issues/39) | [features/records](https://github.com/dotnet/roslyn/tree/features/records) | In progress | [agocke](https://github.com/agocke) | [gafter](https://github.com/gafter), [333fred](https://github.com/333fred) | [agocke](https://github.com/agocke) |
26+
| [Records](https://github.com/dotnet/csharplang/issues/39) | [features/records](https://github.com/dotnet/roslyn/tree/features/records) | [In progress](https://github.com/dotnet/roslyn/issues/40726) | [agocke](https://github.com/agocke) | [gafter](https://github.com/gafter), [333fred](https://github.com/333fred) | [agocke](https://github.com/agocke) |
2727

2828
# C# 8.0
2929

eng/Version.Details.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
<ProductDependencies>
44
</ProductDependencies>
55
<ToolsetDependencies>
6-
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="5.0.0-beta.20128.3">
6+
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="5.0.0-beta.20152.4">
77
<Uri>https://github.com/dotnet/arcade</Uri>
8-
<Sha>5966c5dd9deb5aca8fd8183eec454cf6cf864d14</Sha>
8+
<Sha>d8c2d041341ea7974fd3f2057e9d6afdd4f37598</Sha>
99
</Dependency>
1010
</ToolsetDependencies>
1111
</Dependencies>

eng/Versions.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@
6969
<MicrosoftDiagnosticsRuntimeVersion>0.8.31-beta</MicrosoftDiagnosticsRuntimeVersion>
7070
<MicrosoftDiagnosticsTracingTraceEventVersion>1.0.35</MicrosoftDiagnosticsTracingTraceEventVersion>
7171
<MicrosoftDiaSymReaderVersion>1.3.0</MicrosoftDiaSymReaderVersion>
72-
<MicrosoftDiaSymReaderConverterVersion>1.1.0-beta2-19409-01</MicrosoftDiaSymReaderConverterVersion>
73-
<MicrosoftDiaSymReaderConverterXmlVersion>1.1.0-beta2-19409-01</MicrosoftDiaSymReaderConverterXmlVersion>
72+
<MicrosoftDiaSymReaderConverterVersion>1.1.0-beta2-20115-01</MicrosoftDiaSymReaderConverterVersion>
73+
<MicrosoftDiaSymReaderConverterXmlVersion>1.1.0-beta2-20115-01</MicrosoftDiaSymReaderConverterXmlVersion>
7474
<MicrosoftDiaSymReaderNativeVersion>1.7.0</MicrosoftDiaSymReaderNativeVersion>
7575
<MicrosoftDiaSymReaderPortablePdbVersion>1.5.0</MicrosoftDiaSymReaderPortablePdbVersion>
7676
<MicrosoftDotNetVersionToolsVersion>3.0.0-preview1-03617-02</MicrosoftDotNetVersionToolsVersion>

eng/common/build.ps1

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ Param(
2626
[Parameter(ValueFromRemainingArguments=$true)][String[]]$properties
2727
)
2828

29+
# Unset 'Platform' environment variable to avoid unwanted collision in InstallDotNetCore.targets file
30+
# some computer has this env var defined (e.g. Some HP)
31+
if($env:Platform) {
32+
$env:Platform=""
33+
}
2934
function Print-Usage() {
3035
Write-Host "Common settings:"
3136
Write-Host " -configuration <value> Build configuration: 'Debug' or 'Release' (short: -c)"

eng/config/OptProf.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,6 @@
3434
"filename": "/DesktopHost/System.Numerics.Vectors.dll",
3535
"testCases":[ "ManagedLangs.OptProfTests.DDRIT_RPS_ManagedLangs" ]
3636
},
37-
{
38-
"filename": "/Microsoft.CodeAnalysis.Workspaces.dll",
39-
"testCases":[ "ManagedLangs.OptProfTests.DDRIT_RPS_ManagedLangs" ]
40-
},
4137
{
4238
"filename": "/Microsoft.CodeAnalysis.VisualBasic.dll",
4339
"testCases":[ "ManagedLangs.OptProfTests.DDRIT_RPS_ManagedLangs" ]
@@ -825,4 +821,4 @@
825821
]
826822
}
827823
]
828-
}
824+
}

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
"xcopy-msbuild": "16.4.0-alpha"
88
},
99
"msbuild-sdks": {
10-
"Microsoft.DotNet.Arcade.Sdk": "5.0.0-beta.20128.3"
10+
"Microsoft.DotNet.Arcade.Sdk": "5.0.0-beta.20152.4"
1111
}
1212
}

src/Analyzers/Core/Analyzers/AbstractBuiltInCodeStyleDiagnosticAnalyzer.cs

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

5+
#nullable enable
6+
57
using System.Collections.Immutable;
68
using System.Diagnostics;
79
using System.Linq;
810
using Microsoft.CodeAnalysis.Diagnostics;
911
using Microsoft.CodeAnalysis.Options;
12+
using Roslyn.Utilities;
1013

1114
#if CODE_STYLE
1215
using OptionSet = Microsoft.CodeAnalysis.Diagnostics.AnalyzerConfigOptions;
@@ -22,20 +25,20 @@ internal abstract class AbstractBuiltInCodeStyleDiagnosticAnalyzer : AbstractCod
2225
/// </summary>
2326
/// <param name="diagnosticId">Diagnostic ID reported by this analyzer</param>
2427
/// <param name="option">
25-
/// Per-language option that can be used to configure the given diagnosticId.
26-
/// Null, if there is no such unique option.
28+
/// Per-language option that can be used to configure the given <paramref name="diagnosticId"/>.
29+
/// <see langword="null"/>, if there is no such unique option.
2730
/// </param>
2831
/// <param name="title">Title for the diagnostic descriptor</param>
2932
/// <param name="messageFormat">
3033
/// Message for the diagnostic descriptor.
31-
/// Null if the message is identical to the title.
34+
/// <see langword="null"/> if the message is identical to the title.
3235
/// </param>
3336
/// <param name="configurable">Flag indicating if the reported diagnostics are configurable by the end users</param>
3437
protected AbstractBuiltInCodeStyleDiagnosticAnalyzer(
3538
string diagnosticId,
36-
IPerLanguageOption option,
39+
IPerLanguageOption? option,
3740
LocalizableString title,
38-
LocalizableString messageFormat = null,
41+
LocalizableString? messageFormat = null,
3942
bool configurable = true)
4043
: base(diagnosticId, title, messageFormat, configurable)
4144
{
@@ -48,22 +51,22 @@ protected AbstractBuiltInCodeStyleDiagnosticAnalyzer(
4851
/// </summary>
4952
/// <param name="diagnosticId">Diagnostic ID reported by this analyzer</param>
5053
/// <param name="option">
51-
/// Language specific option that can be used to configure the given diagnosticId.
52-
/// Null, if there is no such unique option.
54+
/// Language specific option that can be used to configure the given <paramref name="diagnosticId"/>.
55+
/// <see langword="null"/>, if there is no such unique option.
5356
/// </param>
5457
/// <param name="language">Language for the given language-specific <paramref name="option"/>.</param>
5558
/// <param name="title">Title for the diagnostic descriptor</param>
5659
/// <param name="messageFormat">
5760
/// Message for the diagnostic descriptor.
58-
/// Null if the message is identical to the title.
61+
/// <see langword="null"/> if the message is identical to the title.
5962
/// </param>
6063
/// <param name="configurable">Flag indicating if the reported diagnostics are configurable by the end users</param>
6164
protected AbstractBuiltInCodeStyleDiagnosticAnalyzer(
6265
string diagnosticId,
63-
ILanguageSpecificOption option,
66+
ILanguageSpecificOption? option,
6467
string language,
6568
LocalizableString title,
66-
LocalizableString messageFormat = null,
69+
LocalizableString? messageFormat = null,
6770
bool configurable = true)
6871
: base(diagnosticId, title, messageFormat, configurable)
6972
{
@@ -88,11 +91,11 @@ protected AbstractBuiltInCodeStyleDiagnosticAnalyzer(
8891
string diagnosticId,
8992
ImmutableHashSet<IPerLanguageOption> options,
9093
LocalizableString title,
91-
LocalizableString messageFormat = null,
94+
LocalizableString? messageFormat = null,
9295
bool configurable = true)
9396
: base(diagnosticId, title, messageFormat, configurable)
9497
{
95-
Debug.Assert(options != null);
98+
RoslynDebug.Assert(options != null);
9699
Debug.Assert(options.Count > 1);
97100
AddDiagnosticIdToOptionMapping(diagnosticId, options);
98101
}
@@ -117,11 +120,11 @@ protected AbstractBuiltInCodeStyleDiagnosticAnalyzer(
117120
ImmutableHashSet<ILanguageSpecificOption> options,
118121
string language,
119122
LocalizableString title,
120-
LocalizableString messageFormat = null,
123+
LocalizableString? messageFormat = null,
121124
bool configurable = true)
122125
: base(diagnosticId, title, messageFormat, configurable)
123126
{
124-
Debug.Assert(options != null);
127+
RoslynDebug.Assert(options != null);
125128
Debug.Assert(options.Count > 1);
126129
AddDiagnosticIdToOptionMapping(diagnosticId, options, language);
127130
}
@@ -180,15 +183,15 @@ protected AbstractBuiltInCodeStyleDiagnosticAnalyzer(ImmutableArray<DiagnosticDe
180183
{
181184
}
182185

183-
private static void AddDiagnosticIdToOptionMapping(string diagnosticId, IPerLanguageOption option)
186+
private static void AddDiagnosticIdToOptionMapping(string diagnosticId, IPerLanguageOption? option)
184187
{
185188
if (option != null)
186189
{
187190
AddDiagnosticIdToOptionMapping(diagnosticId, ImmutableHashSet.Create(option));
188191
}
189192
}
190193

191-
private static void AddDiagnosticIdToOptionMapping(string diagnosticId, ILanguageSpecificOption option, string language)
194+
private static void AddDiagnosticIdToOptionMapping(string diagnosticId, ILanguageSpecificOption? option, string language)
192195
{
193196
if (option != null)
194197
{

src/Analyzers/Core/Analyzers/AbstractCodeStyleDiagnosticAnalyzer.cs

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,24 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

5+
#nullable enable
6+
57
using System.Collections.Immutable;
68
using Microsoft.CodeAnalysis.Diagnostics;
79

810
namespace Microsoft.CodeAnalysis.CodeStyle
911
{
1012
internal abstract class AbstractCodeStyleDiagnosticAnalyzer : DiagnosticAnalyzer
1113
{
12-
protected readonly string DescriptorId;
14+
protected readonly string? DescriptorId;
1315

1416
protected readonly DiagnosticDescriptor Descriptor;
1517

1618
/// <summary>
1719
/// Diagnostic descriptor for code you want to fade out *and* want to have a smart-tag
1820
/// appear for. This is the common descriptor for code that is being faded out
1921
/// </summary>
20-
protected readonly DiagnosticDescriptor UnnecessaryWithSuggestionDescriptor;
22+
protected readonly DiagnosticDescriptor? UnnecessaryWithSuggestionDescriptor;
2123

2224
/// <summary>
2325
/// Diagnostic descriptor for code you want to fade out and do *not* want to have a smart-tag
@@ -31,7 +33,7 @@ internal abstract class AbstractCodeStyleDiagnosticAnalyzer : DiagnosticAnalyzer
3133
/// same issue when they bring up the code action on that line. Using these two descriptors
3234
/// helps ensure that there will not be useless code-action overload.
3335
/// </summary>
34-
protected readonly DiagnosticDescriptor UnnecessaryWithoutSuggestionDescriptor;
36+
protected readonly DiagnosticDescriptor? UnnecessaryWithoutSuggestionDescriptor;
3537

3638
protected readonly LocalizableString _localizableTitle;
3739
protected readonly LocalizableString _localizableMessageFormat;
@@ -40,16 +42,16 @@ internal abstract class AbstractCodeStyleDiagnosticAnalyzer : DiagnosticAnalyzer
4042

4143
protected AbstractCodeStyleDiagnosticAnalyzer(
4244
string descriptorId, LocalizableString title,
43-
LocalizableString messageFormat = null,
45+
LocalizableString? messageFormat = null,
4446
bool configurable = true)
4547
{
4648
DescriptorId = descriptorId;
4749
_localizableTitle = title;
4850
_localizableMessageFormat = messageFormat ?? title;
4951
_configurable = configurable;
5052

51-
Descriptor = CreateDescriptor();
52-
UnnecessaryWithSuggestionDescriptor = CreateUnnecessaryDescriptor();
53+
Descriptor = CreateDescriptorWithId(DescriptorId, _localizableTitle, _localizableMessageFormat);
54+
UnnecessaryWithSuggestionDescriptor = CreateUnnecessaryDescriptor(DescriptorId);
5355
UnnecessaryWithoutSuggestionDescriptor = CreateUnnecessaryDescriptor(descriptorId + "WithoutSuggestion");
5456

5557
SupportedDiagnostics = ImmutableArray.Create(
@@ -59,10 +61,11 @@ protected AbstractCodeStyleDiagnosticAnalyzer(
5961
protected AbstractCodeStyleDiagnosticAnalyzer(ImmutableArray<DiagnosticDescriptor> supportedDiagnostics)
6062
{
6163
SupportedDiagnostics = supportedDiagnostics;
62-
}
6364

64-
protected DiagnosticDescriptor CreateUnnecessaryDescriptor()
65-
=> CreateUnnecessaryDescriptor(DescriptorId);
65+
Descriptor = SupportedDiagnostics[0];
66+
_localizableTitle = Descriptor.Title;
67+
_localizableMessageFormat = Descriptor.MessageFormat;
68+
}
6669

6770
protected DiagnosticDescriptor CreateUnnecessaryDescriptor(string descriptorId)
6871
=> CreateDescriptorWithId(
@@ -71,19 +74,13 @@ protected DiagnosticDescriptor CreateUnnecessaryDescriptor(string descriptorId)
7174

7275
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; }
7376

74-
protected DiagnosticDescriptor CreateDescriptor(params string[] customTags)
75-
=> CreateDescriptorWithId(DescriptorId, _localizableTitle, _localizableMessageFormat, customTags: customTags);
76-
77-
protected DiagnosticDescriptor CreateDescriptorWithTitle(LocalizableString title, params string[] customTags)
78-
=> CreateDescriptorWithId(DescriptorId, title, title, customTags: customTags);
79-
8077
protected static DiagnosticDescriptor CreateDescriptorWithId(
8178
string id,
8279
LocalizableString title,
8380
LocalizableString messageFormat,
8481
bool isUnnecessary = false,
8582
bool isConfigurable = true,
86-
LocalizableString description = null,
83+
LocalizableString? description = null,
8784
params string[] customTags)
8885
=> new DiagnosticDescriptor(
8986
id, title, messageFormat,

0 commit comments

Comments
 (0)