Skip to content

Commit

Permalink
Merge branch 'main' into merges/release/dev17.3-to-main
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeRobich authored Apr 29, 2022
2 parents 34cc642 + 676b186 commit 3b46d46
Show file tree
Hide file tree
Showing 692 changed files with 13,110 additions and 4,439 deletions.
6 changes: 4 additions & 2 deletions docs/Language Feature Status.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ efforts behind them.
| [Parameter null-checking](https://github.com/dotnet/csharplang/issues/2145) | [param-nullchecking](https://github.com/dotnet/roslyn/tree/features/param-nullchecking) | [Merged in 17.1p3](https://github.com/dotnet/roslyn/issues/36024) | [RikkiGibson](https://github.com/RikkiGibson), [fayrose](https://github.com/fayrose) | [cston](https://github.com/cston), [chsienki](https://github.com/chsienki) | [jaredpar](https://github.com/jaredpar) |
| [Raw string literals](https://github.com/dotnet/csharplang/issues/4304) | [RawStringLiterals](https://github.com/dotnet/roslyn/tree/features/RawStringLiterals) | [Merged into 17.2](https://github.com/dotnet/roslyn/issues/55306) | [CyrusNajmabadi](https://github.com/CyrusNajmabadi) | [jcouv](https://github.com/jcouv) | [CyrusNajmabadi](https://github.com/CyrusNajmabadi) |
| [Cache delegates for static method group](https://github.com/dotnet/roslyn/issues/5835) | main | [Merged into 17.2](https://github.com/dotnet/roslyn/pull/58288) | [pawchen](https://github.com/pawchen) | [AlekseyTs](https://github.com/AlekseyTs), [jcouv](https://github.com/jcouv) | [AlekseyTs](https://github.com/AlekseyTs) |
| [nameof(parameter)](https://github.com/dotnet/csharplang/issues/373) | main | [In Progress](https://github.com/dotnet/roslyn/issues/40524) | [jcouv](https://github.com/jcouv) | TBD | [jcouv](https://github.com/jcouv) |
| [nameof(parameter)](https://github.com/dotnet/csharplang/issues/373) | main | [Merged into 17.3p2](https://github.com/dotnet/roslyn/issues/40524) | [jcouv](https://github.com/jcouv) | [AlekseyTs](https://github.com/AlekseyTs), [RikkiGibson](https://github.com/RikkiGibson) | [jcouv](https://github.com/jcouv) |
| [Relaxing Shift Operator](https://github.com/dotnet/csharplang/issues/4666) | main | [Merged into 17.3p2](https://github.com/dotnet/roslyn/issues/60967) | [AlekseyTs](https://github.com/AlekseyTs) | [333fred](https://github.com/333fred), [jcouv](https://github.com/jcouv) | [MadsTorgersen](https://github.com/MadsTorgersen) |
| [Relax ordering of `ref` and `partial` modifiers](https://github.com/dotnet/csharplang/issues/946) | [ref-partial](https://github.com/dotnet/roslyn/tree/features/ref-partial) | In Progress | [alrz](https://github.com/alrz) | [gafter](https://github.com/gafter) | [jcouv](https://github.com/jcouv) |
| [Generic attributes](https://github.com/dotnet/csharplang/issues/124) | [generic-attributes](https://github.com/dotnet/roslyn/tree/features/generic-attributes) | [Merged into 17.0p4 (preview langver)](https://github.com/dotnet/roslyn/issues/36285) | [AviAvni](https://github.com/AviAvni) | [RikkiGibson](https://github.com/RikkiGibson), [jcouv](https://github.com/jcouv) | [mattwar](https://github.com/mattwar) |
| [Default in deconstruction](https://github.com/dotnet/roslyn/pull/25562) | [decon-default](https://github.com/dotnet/roslyn/tree/features/decon-default) | [Implemented](https://github.com/dotnet/roslyn/issues/25559) | [jcouv](https://github.com/jcouv) | [gafter](https://github.com/gafter) | [jcouv](https://github.com/jcouv) |
Expand All @@ -31,8 +32,9 @@ efforts behind them.
| [Pattern matching on `ReadOnlySpan<char>`](https://github.com/dotnet/csharplang/issues/1881) | [patterns-span-char](https://github.com/dotnet/roslyn/tree/features/patterns-span-char) | [Merged into 17.3p1](https://github.com/dotnet/roslyn/issues/59191) | [YairHalberstadt ](https://github.com/YairHalberstadt) | [cston](https://github.com/cston), [RikkiGibson](https://github.com/RikkiGibson) | [jcouv](https://github.com/jcouv) |
| [nameof accessing instance members](https://github.com/dotnet/roslyn/issues/40229) | main | [In Progress](https://github.com/dotnet/roslyn/pull/48754) | [YairHalberstadt ](https://github.com/YairHalberstadt) | [333fred](https://github.com/333fred), [AlekseyTs](https://github.com/AlekseyTs) | [333fred](https://github.com/333fred) |
| [ref fields](https://github.com/dotnet/csharplang/blob/main/proposals/low-level-struct-improvements.md) | [ref-fields](https://github.com/dotnet/roslyn/tree/features/ref-fields) | [In Progress](https://github.com/dotnet/roslyn/issues/59194) | [cston](https://github.com/cston) | [RikkiGibson](https://github.com/RikkiGibson), [AlekseyTs](https://github.com/AlekseyTs) | [jaredpar](https://github.com/jaredpar) |
| Numeric IntPtr | [numeric-intptr](https://github.com/dotnet/roslyn/tree/features/numeric-intptr) | [In Progress](https://github.com/dotnet/roslyn/issues/60578) | [jcouv](https://github.com/jcouv) | TBD | [jcouv](https://github.com/jcouv) |
| [Numeric IntPtr](https://github.com/dotnet/csharplang/issues/6065) | [numeric-intptr](https://github.com/dotnet/roslyn/tree/features/numeric-intptr) | [In Progress](https://github.com/dotnet/roslyn/issues/60578) | [jcouv](https://github.com/jcouv) | [cston](https://github.com/cston), [333fred](https://github.com/333fred) | [jcouv](https://github.com/jcouv) |
| [File types](https://github.com/dotnet/csharplang/issues/6011) | [file-types](https://github.com/dotnet/roslyn/tree/features/file-types) | [In Progress](https://github.com/dotnet/roslyn/issues/60819) | [RikkiGibson](https://github.com/RikkiGibson) | [333fred](https://github.com/333fred), [cston](https://github.com/cston) | [stephentoub](https://github.com/stephentoub) |
| [DIM for Static Members](https://github.com/dotnet/csharplang/issues/4436) | [DefaultInterfaceImplementation](https://github.com/dotnet/roslyn/tree/features/DefaultInterfaceImplementation) | [In Progress](https://github.com/dotnet/roslyn/issues/60968) | [AlekseyTs](https://github.com/AlekseyTs) | [333fred](https://github.com/333fred), [jcouv](https://github.com/jcouv) | [MadsTorgersen](https://github.com/MadsTorgersen) |

# C# 10.0

Expand Down
45 changes: 45 additions & 0 deletions docs/compilers/CSharp/Compiler Breaking Changes - DotNet 7.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,50 @@
# This document lists known breaking changes in Roslyn after .NET 6 all the way to .NET 7.

## Nameof operator in attribute on method or local function

***Introduced in .NET SDK 7.0.400, Visual Studio 2022 version 17.3.***

When the language version is C# 11 or later, a `nameof` operator in an attribute on a method
brings the type parameters of that method in scope. The same applies for local functions.
A `nameof` operator in an attribute on a method, its type parameters or parameters brings
the parameters of that method in scope. The same applies to local functions, lambdas,
delegates and indexers.

For instance, these will now be errors:
```csharp
class C
{
class TParameter
{
internal const string Constant = """";
}
[MyAttribute(nameof(TParameter.Constant))]
void M<TParameter>() { }
}
```
```csharp
class C
{
class parameter
{
internal const string Constant = """";
}
[MyAttribute(nameof(parameter.Constant))]
void M(int parameter) { }
}
```

Possible workarounds are:

1. Rename the type parameter or parameter to avoid shadowing the name from outer scope.
1. Use a string literal instead of the `nameof` operator.
1. Downgrade the `<LangVersion>` element to 9.0 or earlier.

Note: The break will also apply to C# 10 and earlier when .NET 7 ships, but is
currently scoped down to users of LangVer=preview.
Tracked by https://github.com/dotnet/roslyn/issues/60640

## Unsigned right shift operator

***Introduced in .NET SDK 6.0.400, Visual Studio 2022 version 17.3.***
Expand Down
2 changes: 1 addition & 1 deletion docs/features/source-generators.cookbook.md
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,7 @@ using VerifyCS = CSharpSourceGeneratorVerifier<YourGenerator>;
And use the following in your test method:

```csharp
var code = "initial code"
var code = "initial code";
var generated = "expected generated code";
await new VerifyCS.Test
{
Expand Down
2 changes: 1 addition & 1 deletion eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<MajorVersion>4</MajorVersion>
<MinorVersion>3</MinorVersion>
<PatchVersion>0</PatchVersion>
<PreReleaseVersionLabel>1</PreReleaseVersionLabel>
<PreReleaseVersionLabel>2</PreReleaseVersionLabel>
<VersionPrefix>$(MajorVersion).$(MinorVersion).$(PatchVersion)</VersionPrefix>
<!--
By default the assembly version in official builds is "$(MajorVersion).$(MinorVersion).0.0".
Expand Down
188 changes: 5 additions & 183 deletions eng/config/PublishData.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,130 +60,28 @@
"Microsoft.CodeAnalysis.Remote.Workspaces": "vs-impl",
"Microsoft.VisualStudio.LanguageServices.LiveShare": "vs-impl",
"Microsoft.VisualStudio.LanguageServices.Razor.RemoteClient": "vs-impl"
},
"arcade": {
"Microsoft.CodeAnalysis": "arcade",
"Microsoft.CodeAnalysis.Common": "arcade",
"Microsoft.CodeAnalysis.Compilers": "arcade",
"Microsoft.CodeAnalysis.Scripting": "arcade",
"Microsoft.CodeAnalysis.Scripting.Common": "arcade",
"Microsoft.CodeAnalysis.Workspaces.Common": "arcade",
"Microsoft.CodeAnalysis.Workspaces.MSBuild": "arcade",
"Microsoft.CodeAnalysis.Workspaces.Desktop": "arcade",
"Microsoft.CodeAnalysis.CSharp": "arcade",
"Microsoft.CodeAnalysis.CSharp.CodeStyle": "arcade",
"Microsoft.CodeAnalysis.CSharp.Features": "arcade",
"Microsoft.CodeAnalysis.CSharp.Scripting": "arcade",
"Microsoft.CodeAnalysis.CSharp.Workspaces": "arcade",
"Microsoft.CodeAnalysis.VisualBasic": "arcade",
"Microsoft.CodeAnalysis.VisualBasic.CodeStyle": "arcade",
"Microsoft.CodeAnalysis.VisualBasic.Features": "arcade",
"Microsoft.CodeAnalysis.VisualBasic.Workspaces": "arcade",
"Microsoft.CodeAnalysis.Build.Tasks": "arcade",
"Microsoft.Net.Compilers": "arcade",
"Microsoft.Net.Compilers.Toolset": "arcade",
"Microsoft.NETCore.Compilers": "arcade",
"Microsoft.CodeAnalysis.Debugging": "arcade",
"Microsoft.CodeAnalysis.PooledObjects": "arcade",
"Microsoft.CodeAnalysis.Collections": "arcade",
"Microsoft.CodeAnalysis.Features": "arcade",
"Microsoft.CodeAnalysis.EditorFeatures": "arcade",
"Microsoft.CodeAnalysis.EditorFeatures.Common": "arcade",
"Microsoft.CodeAnalysis.EditorFeatures.Text": "arcade",
"Microsoft.VisualStudio.LanguageServices": "arcade",
"Microsoft.CodeAnalysis.CSharp.EditorFeatures": "arcade",
"Microsoft.CodeAnalysis.InteractiveHost": "arcade",
"Microsoft.CodeAnalysis.VisualBasic.EditorFeatures": "arcade",
"Microsoft.CodeAnalysis.EditorFeatures.Wpf": "arcade",
"Microsoft.CodeAnalysis.EditorFeatures.Cocoa": "arcade",
"Microsoft.VisualStudio.IntegrationTest.Utilities": "arcade",
"Microsoft.CodeAnalysis.LanguageServer.Protocol": "arcade",
"Microsoft.CodeAnalysis.Lsif.Generator": "arcade",
"Microsoft.CodeAnalysis.ExternalAccess.Apex": "arcade",
"Microsoft.CodeAnalysis.ExternalAccess.CodeLens": "arcade",
"Microsoft.CodeAnalysis.ExternalAccess.Debugger": "arcade",
"Microsoft.CodeAnalysis.ExternalAccess.FSharp": "arcade",
"Microsoft.CodeAnalysis.ExternalAccess.IntelliTrace": "arcade",
"Microsoft.CodeAnalysis.ExternalAccess.ProjectSystem": "arcade",
"Microsoft.CodeAnalysis.ExternalAccess.OmniSharp": "arcade",
"Microsoft.CodeAnalysis.ExternalAccess.OmniSharp.CSharp": "arcade",
"Microsoft.CodeAnalysis.ExternalAccess.Razor": "arcade",
"Microsoft.CodeAnalysis.ExternalAccess.TypeScript": "arcade",
"Microsoft.CodeAnalysis.ExternalAccess.UnitTesting": "arcade",
"Microsoft.CodeAnalysis.ExternalAccess.Xamarin.Remote": "arcade",
"Microsoft.CodeAnalysis.ExternalAccess.DotNetWatch": "arcade",
"Microsoft.CodeAnalysis.Remote.Razor.ServiceHub": "arcade",
"Microsoft.CodeAnalysis.Remote.ServiceHub": "arcade",
"Microsoft.CodeAnalysis.Remote.Workspaces": "arcade",
"Microsoft.VisualStudio.LanguageServices.LiveShare": "arcade",
"Microsoft.VisualStudio.LanguageServices.Razor.RemoteClient": "arcade"
}
},
"comment-about-servicing-branches": "For a list of VS versions under servicing, see https://docs.microsoft.com/en-us/visualstudio/releases/2019/servicing#support-options-for-enterprise-and-professional-customers",
"branches": {
"dev15.9.x-vs-deps": {
"nugetKind": "PerBuildPreRelease",
"version": "2.10.*",
"nuget": [],
"vsix": null,
"channels": [],
"vsBranch": "rel/d15.9",
"vsMajorVersion": 15
},
"release/dev16.4-vs-deps": {
"nugetKind": [
"Shipping"
],
"version": "3.4.*",
"nuget": [],
"vsix": null,
"channels": [],
"vsBranch": "rel/d16.4",
"vsMajorVersion": 16
},
"release/dev16.7-vs-deps": {
"nugetKind": [
"Shipping",
"NonShipping"
],
"version": "3.7.*",
"nuget": [],
"vsix": null,
"channels": [],
"vsBranch": "rel/d16.7",
"vsMajorVersion": 16
},
"release/dev16.9-vs-deps": {
"nugetKind": [
"Shipping",
"NonShipping"
],
"version": "3.9.*",
"packageFeeds": "default",
"channels": [],
"vsBranch": "rel/d16.9",
"vsMajorVersion": 16
},
"release/dev16.10-vs-deps": {
"nugetKind": [
"Shipping",
"NonShipping"
],
"version": "3.10.*",
"packageFeeds": "default",
"channels": [],
"vsBranch": "rel/d16.10",
"vsMajorVersion": 16,
"insertionTitlePrefix": "[d16.10]"
},
"release/dev16.11-vs-deps": {
"nugetKind": [
"Shipping",
"NonShipping"
],
"version": "3.11.*",
"packageFeeds": "default",
"channels": [],
"vsBranch": "rel/d16.11",
"vsMajorVersion": 16,
"insertionTitlePrefix": "[d16.11]"
Expand All @@ -193,9 +91,6 @@
"Shipping",
"NonShipping"
],
"version": "4.0.*",
"packageFeeds": "default",
"channels": [],
"vsBranch": "rel/d17.0",
"vsMajorVersion": 17,
"insertionTitlePrefix": "[d17.0]"
Expand All @@ -205,9 +100,6 @@
"Shipping",
"NonShipping"
],
"version": "4.1.*",
"packageFeeds": "default",
"channels": [],
"vsBranch": "rel/d17.1",
"vsMajorVersion": 17,
"insertionTitlePrefix": "[d17.1]"
Expand All @@ -217,14 +109,11 @@
"Shipping",
"NonShipping"
],
"version": "4.2.*",
"packageFeeds": "default",
"channels": [],
"vsBranch": "rel/d17.2",
"vsMajorVersion": 17,
"insertionTitlePrefix": "[d17.2]"
},
"main": {
"release/dev17.3": {
"nugetKind": [
"Shipping",
"NonShipping"
Expand All @@ -234,84 +123,17 @@
"channels": [],
"vsBranch": "main",
"vsMajorVersion": 17,
"insertionCreateDraftPR": false,
"insertionTitlePrefix": "[d17.3p1]"
},
"features/NullableReferenceTypes": {
"nugetKind": "PerBuildPreRelease",
"version": "2.6.*",
"nuget": [],
"vsix": null,
"channels": [
"nonnull"
],
"vsBranch": "lab/d16.1stg",
"vsMajorVersion": 16
},
"features/dataflow": {
"nugetKind": "PerBuildPreRelease",
"version": "2.8.*",
"nuget": [],
"vsix": null,
"channels": [
"dataflow"
],
"vsBranch": "lab/d16.1stg",
"vsMajorVersion": 16
},
"features/razorSupport2": {
"nugetKind": [
"Shipping",
"NonShipping"
],
"version": "3.1.*",
"nuget": [],
"vsix": null,
"channels": [],
"vsBranch": "lab/d16.1stg",
"vsMajorVersion": 16
},
"features/compilerNext": {
"main": {
"nugetKind": [
"Shipping",
"NonShipping"
],
"version": "3.4.*",
"nuget": [],
"vsix": null,
"channels": [],
"vsBranch": "main",
"vsMajorVersion": 16
},
"features/unitTesting": {
"nugetKind": [
"Shipping",
"NonShipping"
],
"version": "3.3.*",
"nuget": [],
"vsix": null,
"channels": [],
"vsBranch": "rel/d16.5",
"vsMajorVersion": 16
}
},
"releases": {
"dev15.5": {
"nugetKind": "Release",
"version": "2.3.*",
"nuget": [
"https://api.nuget.org/v3/index.json"
],
"channels": []
},
"dev15.6": {
"nugetKind": "Release",
"version": "2.7.*",
"nuget": [
"https://api.nuget.org/v3/index.json"
],
"channels": []
"vsMajorVersion": 17,
"insertionCreateDraftPR": true,
"insertionTitlePrefix": "[d17.3p2 validation]"
}
}
}
14 changes: 13 additions & 1 deletion eng/publish-assets.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,21 @@ function Publish-Nuget($publishData, [string]$packageDir) {
# Retrieve the feed name to source mapping.
$feedData = GetFeedPublishData

# Let packageFeeds default to the default set of feeds
$packageFeeds = "default"
if ($publishData.PSobject.Properties.Name -contains "packageFeeds") {
$packageFeeds = $publishData.packageFeeds
}

# If the configured packageFeeds is arcade, then skip publishing here. Arcade will handle publishing packages to their feeds.
if ($packageFeeds.equals("arcade")) {
Write-Host " Skipping publishing for all packages as they will be published by arcade"
continue
}

# Each branch stores the name of the package to feed map it should use.
# Retrieve the correct map for this particular branch.
$packagesData = GetPackagesPublishData $publishData.packageFeeds
$packagesData = GetPackagesPublishData $packageFeeds

foreach ($package in Get-ChildItem *.nupkg) {
$nupkg = Split-Path -Leaf $package
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// See the LICENSE file in the project root for more information.

using Microsoft.CodeAnalysis.Diagnostics;
using Roslyn.Utilities;

namespace Microsoft.CodeAnalysis.CSharp.Simplification;

Expand All @@ -13,6 +14,11 @@ internal static CSharpSimplifierOptions GetCSharpSimplifierOptions(this Analyzer
var configOptions = options.AnalyzerConfigOptionsProvider.GetOptions(syntaxTree);
var ideOptions = options.GetIdeOptions();

return CSharpSimplifierOptions.Create(configOptions, (CSharpSimplifierOptions?)ideOptions.SimplifierOptions);
#if CODE_STYLE
var fallbackOptions = (CSharpSimplifierOptions?)null;
#else
var fallbackOptions = (CSharpSimplifierOptions?)ideOptions.CleanupOptions?.SimplifierOptions;
#endif
return CSharpSimplifierOptions.Create(configOptions, fallbackOptions);
}
}
Loading

0 comments on commit 3b46d46

Please sign in to comment.