Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into features/function…
Browse files Browse the repository at this point in the history
…-pointers

* upstream/master: (207 commits)
  Update argument state when parameter has not-null type (dotnet#46072)
  Fix TypeWithAnnotations.ToTypeWithState() for (untyped) null literal (dotnet#46344)
  Update README (dotnet#46136)
  Revert "Revert "Support nullable annotations on unconstrained type parameters""
  Revert "Support nullable annotations on unconstrained type parameters (dotnet#45993)"
  Fix type in publish data
  Update VSIXExpInstaller version to one available on ADO
  Update publish data for 16.8
  Update version of RichCodeNav.EnvVarDump
  A fixed initializer must be bound to its natural type (dotnet#46293)
  Update features merged into 16.7p4 (dotnet#46229)
  Async-streams: disposal should continue without jump within a finally (dotnet#46188)
  Recommend default in type constraint, but not record (dotnet#46311)
  Add use site diagnostics to IsUnmanaged (dotnet#46114)
  Add another flaky test.
  Ensure NuGet connections use TLS 1.2
  Update to Microsoft.CodeAnalysis.Testing 1.0.1-beta1.20374.2
  Skip flaky test.
  Fix build break. (dotnet#46303)
  Skip a flaky test Relates to dotnet#46304
  ...
  • Loading branch information
333fred committed Jul 28, 2020
2 parents 0e27359 + 71e720e commit cb3cc96
Show file tree
Hide file tree
Showing 923 changed files with 31,255 additions and 14,900 deletions.
10 changes: 8 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ dotnet_diagnostic.RS0037.severity = none
# warning RS0005: Do not use generic CodeAction.Create to create CodeAction
dotnet_diagnostic.RS0005.severity = none

[src/{Analyzers,CodeStyle,Features,Workspaces,EditorFeatures}/**/*.{cs,vb}]
[src/{Analyzers,CodeStyle,Features,Workspaces,EditorFeatures, VisualStudio}/**/*.{cs,vb}]

# IDE0011: Add braces
csharp_prefer_braces = when_multiline:warning
Expand Down Expand Up @@ -267,4 +267,10 @@ dotnet_diagnostic.CA1822.severity = warning
dotnet_diagnostic.IDE0007.severity = warning
csharp_style_var_for_built_in_types = true:warning
csharp_style_var_when_type_is_apparent = true:warning
csharp_style_var_elsewhere = true:warning
csharp_style_var_elsewhere = true:warning

[src/{VisualStudio}/**/*.{cs,vb}]
# CA1822: Make member static
# Not enforced as a build 'warning' for 'VisualStudio' layer due to large number of false positives from https://github.com/dotnet/roslyn-analyzers/issues/3857 and https://github.com/dotnet/roslyn-analyzers/issues/3858
# Additionally, there is a risk of accidentally breaking an internal API that partners rely on though IVT.
dotnet_diagnostic.CA1822.severity = suggestion
8 changes: 0 additions & 8 deletions NuGet.config
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,6 @@
<add key="dotnet-tools" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json" />
<add key="dotnet5" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json" />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
<!-- Microsoft.CodeAnalysis.Test.Resource.Proprietary -->
<add key="roslyn-tools" value="https://dotnet.myget.org/F/roslyn-tools/api/v3/index.json" />
<add key="roslyn-analyzers" value="https://dotnet.myget.org/F/roslyn-analyzers/api/v3/index.json" />
<!-- Microsoft.VisualStudio.* packages (e.g. Microsoft.VisualStudio.ImageCatalog): https://github.com/dotnet/roslyn/issues/43242 -->
<add key="vs-editor" value="https://myget.org/F/vs-editor/api/v3/index.json" />
<!-- Microsoft.VisualStudio.ProjectSystem.Managed -->
<add key="roslyn" value="https://dotnet.myget.org/F/roslyn/api/v3/index.json" />
<add key="roslyn_concord" value="https://myget.org/F/roslyn_concord/api/v3/index.json" />
<add key="vssdk" value="https://pkgs.dev.azure.com/azure-public/vside/_packaging/vssdk/nuget/v3/index.json" />
<add key="vs-impl" value="https://pkgs.dev.azure.com/azure-public/vside/_packaging/vs-impl/nuget/v3/index.json" />
<add key="vs-buildservices" value="https://pkgs.dev.azure.com/azure-public/vside/_packaging/vs-buildservices/nuget/v3/index.json" />
Expand Down
65 changes: 35 additions & 30 deletions README.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions azure-pipelines-official.yml
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ stages:
- template: /eng/common/templates/job/publish-build-assets.yml
parameters:
publishUsingPipelines: true
dependsOn:
dependsOn:
- OfficialBuild
queue:
name: Hosted VS2017
Expand Down Expand Up @@ -311,4 +311,4 @@ stages:
-TsaIterationPath $(_TsaIterationPath)
-TsaRepositoryName $(_TsaRepositoryName)
-TsaCodebaseName $(_TsaCodebaseName)
-TsaPublish $True
-TsaPublish $True
6 changes: 3 additions & 3 deletions docs/Language Feature Status.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ efforts behind them.
| [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) |
| [Function pointers](https://github.com/dotnet/csharplang/issues/191) | [function-pointers](https://github.com/dotnet/roslyn/tree/features/function-pointers) | [Merged into 16.7p3](https://github.com/dotnet/roslyn/issues/43321) | [333fred](https://github.com/333fred) | [AlekseyTs](https://github.com/AlekseyTs) | [jaredpar](https://github.com/jaredpar) |
| [Pattern matching improvements](https://github.com/dotnet/csharplang/issues/2850) | master | [Merged into 16.7p1](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) |
| [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) |
| [Static lambdas](https://github.com/dotnet/csharplang/issues/275) | [features/static-lambdas](https://github.com/dotnet/roslyn/tree/features/static-lambdas) | [Merged in 16.7p4](https://github.com/dotnet/roslyn/issues/39606) | [CyrusNajmabadi](https://github.com/CyrusNajmabadi) | [jcouv](https://github.com/jcouv) | [jcouv](https://github.com/jcouv) |
| [Records](https://github.com/dotnet/csharplang/issues/39) | [features/records](https://github.com/dotnet/roslyn/tree/features/records) | [Merged into 16.7p3](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) |
| [Target-typed conditional](https://github.com/dotnet/csharplang/issues/2460) | [features/target-typing](https://github.com/dotnet/roslyn/tree/features/target-typing) | [In Progress](https://github.com/dotnet/roslyn/issues/43186) | [gafter](https://github.com/gafter) | [agocke](https://github.com/agocke), [RikkiGibson](https://github.com/RikkiGibson) | [gafter](https://github.com/gafter) |
| [Target-typed conditional](https://github.com/dotnet/csharplang/issues/2460) | [features/target-typing](https://github.com/dotnet/roslyn/tree/features/target-typing) | [Merged into 16.7p4](https://github.com/dotnet/roslyn/issues/43186) | [gafter](https://github.com/gafter) | [agocke](https://github.com/agocke), [RikkiGibson](https://github.com/RikkiGibson) | [gafter](https://github.com/gafter) |
| [Covariant](https://github.com/dotnet/csharplang/issues/49) [Returns](https://github.com/dotnet/csharplang/issues/2844) | [features/covariant-returns](https://github.com/dotnet/roslyn/tree/features/covariant-returns) | [In Progress](https://github.com/dotnet/roslyn/issues/43188) | [gafter](https://github.com/gafter) | [AlekseyTs](https://github.com/AlekseyTs), [agocke](https://github.com/agocke) | [gafter](https://github.com/gafter) |
| [Extension GetEnumerator](https://github.com/dotnet/csharplang/issues/3194) | [features/extension-foreach](https://github.com/dotnet/roslyn/tree/features/extension-foreach) | [In Progress](https://github.com/dotnet/roslyn/issues/43184) | [YairHalberstadt](https://github.com/YairHalberstadt) | [333fred](https://github.com/333fred) | [333fred](https://github.com/333fred) |
| [Module initializers](https://github.com/dotnet/csharplang/blob/master/proposals/module-initializers.md) | [features/module-initializers](https://github.com/dotnet/roslyn/tree/features/module-initializers) | [In progress / design](https://github.com/dotnet/roslyn/issues/40500) | [RikkiGibson](https://github.com/RikkiGibson) [jnm2](https://github.com/jnm2)| [AlekseyTs](https://github.com/AlekseyTs) | [gafter](https://github.com/gafter) |
| [Module initializers](https://github.com/dotnet/csharplang/blob/master/proposals/module-initializers.md) | [features/module-initializers](https://github.com/dotnet/roslyn/tree/features/module-initializers) | [Merged in 16.7p4](https://github.com/dotnet/roslyn/issues/40500) | [RikkiGibson](https://github.com/RikkiGibson) [jnm2](https://github.com/jnm2)| [AlekseyTs](https://github.com/AlekseyTs) | [gafter](https://github.com/gafter) |
| [Extending Partial](https://github.com/jaredpar/csharplang/blob/partial/proposals/extending-partial-methods.md) | [features/partial-methods](https://github.com/dotnet/roslyn/tree/features/partial-methods) | [Merged into 16.7p2](https://github.com/dotnet/roslyn/issues/43795) | [RikkiGibson](https://github.com/RikkiGibson) | [chsienki](https://github.com/chsienki) | [jaredpar](https://github.com/jaredpar) |
| [Top-level statements](https://github.com/dotnet/csharplang/blob/master/proposals/top-level-statements.md) | [features/SimplePrograms](https://github.com/dotnet/roslyn/tree/features/SimplePrograms) | [Merged into 16.7p3](https://github.com/dotnet/roslyn/issues/43563) | [AlekseyTs](https://github.com/AlekseyTs) | [cston](https://github.com/cston), [RikkiGibson](https://github.com/RikkiGibson) | [MadsTorgersen](https://github.com/MadsTorgersen) |

Expand Down
14 changes: 13 additions & 1 deletion docs/compilers/CSharp/Compiler Breaking Changes - DotNet 5.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## This document lists known breaking changes in Roslyn in C# 9.0 which will be introduced with .NET 5.
## This document lists known breaking changes in Roslyn in C# 9.0 which will be introduced with .NET 5 (Visual Studio 2019 version 16.8).

1. Beginning with C# 9.0, when you switch on a value of type `byte` or `sbyte`, the compiler tracks which values have been handled and which have not. Technically, we do so for all numeric types, but in practice it is only a breaking change for the types `byte` and `sbyte`. For example, the following program contains a switch statement that explicitly handles *all* of the possible values of the switch's controlling expression
```csharp
Expand Down Expand Up @@ -58,3 +58,15 @@
o is sbyte or short or int or long;
```
Because the `and` and `or` combinators can follow a type pattern, the compiler interprets them as part of the pattern combinator rather than an identifier for the declaration pattern. Consequently, it is an error to use `or` or `and` as pattern variable identifiers starting with C# 9.0.

4. https://github.com/dotnet/roslyn/pull/44841 In *C# 9* and onwards the language views ambiguities between the `record` identifier as being
either a type syntax or a record declaration as choosing the record declaration. The following examples will now be record declarations:

```C#
abstract class C
{
record R2() { }
abstract record R3();
}
```

11 changes: 0 additions & 11 deletions docs/compilers/CSharp/Compiler Breaking Changes - post VS2019.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,3 @@ public class Derived : Base<string?>
public override string? M() { ... } // Derived.M doesn't honor the nullability declaration made by Base.M with its [NotNull] attribute
}
```

19. https://github.com/dotnet/roslyn/pull/44841 In *C# 9* and onwards the language views ambiguities between the `record` identifier as being
either a type syntax or a record declaration as choosing the record declaration. The following examples will now be record declarations:

```C#
abstract class C
{
record R2() { }
abstract record R3();
}
```
28 changes: 13 additions & 15 deletions docs/compilers/CSharp/Warnversion Warning Waves.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,23 @@
# /warnversion warning "waves"
# /warn warning "waves"

The C# compiler flag `/warnversion` controls optional warnings.
The C# compiler flag `/warn` controls optional warnings.
When we introduce new warnings that can be reported on existing code,
we do so under an opt-in system so that programmers do not see new warnings
without taking action to enable them.
For that purpose, we have introduced the compiler flag "`/warnversion=n`"
where `n` is a whole number or a decimal number.
For a warning that was introduced in dotnet version `k`,
that warning will be produced if the warning version `n` specified when compiling is
greater than or equal to `k` and a compiler shipped with dotnet version
`k` or later is used to compile the code.
For that purpose, we have the compiler flag "`/warn:n`"
where `n` is a whole number.

The compiler shipped with dotnet 5 (the C# 9 compiler) contains some warnings, documented below, that
are reported only under `/warn:5` or higher.

The default warning level when the command-line compiler is used is `4`.

The default warning version is `0` (produce no optional warnings).
Our first warning under control of `/warnversion` was introduced in version `5`
as part of .NET 5.
If you want the compiler to produce all applicable warnings, you can specify
`/warnversion=9999`.
In the project file, the property used to specify the warning version is `AnalysisLevel`.
`/warn:9999`.

The table below describes all of the warnings controlled by `/warnversion`.
The table below describes all of the warnings controlled by warning levels `5` or greater.

| Warning ID | warnversion | Description |
| Warning ID | warning level | Description |
|------------|---------|-------------|
| CS7023 | 5 | [A static type is used in an 'is' or 'as' expression](https://github.com/dotnet/roslyn/issues/30198) |
| CS8073 | 5 | [Expression always true (or false) when comparing a struct to null](https://github.com/dotnet/roslyn/issues/45744) |
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ The minimal required version of .NET Framework is 4.7.2.
- Ensure Visual Studio is on Version "16.5" or greater
- Ensure "Use previews of the .NET Core SDK" is checked in Tools -> Options -> Environment -> Preview Features
- Restart Visual Studio
1. [.NET Core SDK 3.1](https://dotnet.microsoft.com/download/dotnet-core/3.0) [Windows x64 installer](https://dotnet.microsoft.com/download/dotnet-core/thank-you/sdk-3.1.100-windows-x64-installer)
1. [.NET Core SDK 5.0 Preview 7](https://dotnet.microsoft.com/download/dotnet-core/5.0) [Windows x64 installer](https://dotnet.microsoft.com/download/dotnet/thank-you/sdk-5.0.100-preview.7-windows-x64-installer)
1. [PowerShell 5.0 or newer](https://docs.microsoft.com/en-us/powershell/scripting/setup/installing-windows-powershell). If you are on Windows 10, you are fine; you'll only need to upgrade if you're on earlier versions of Windows. The download link is under the ["Upgrading existing Windows PowerShell"](https://docs.microsoft.com/en-us/powershell/scripting/install/installing-windows-powershell?view=powershell-6#upgrading-existing-windows-powershell) heading.
1. Run Restore.cmd
1. Open Roslyn.sln
Expand Down
3 changes: 3 additions & 0 deletions docs/contributing/Compiler Test Plan.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ This document provides guidance for thinking about language interactions and tes
- Ref structs, Readonly structs
- Readonly members on structs (methods, property/indexer accessors, custom event accessors)
- SkipLocalsInit
- Method override or explicit implementation with `where T : { class, struct, default }`

# Code
- Operators (see Eric's list below)
Expand Down Expand Up @@ -93,6 +94,8 @@ This document provides guidance for thinking about language interactions and tes
- Patterns (constant, declaration, `var`, positional, property, and discard forms)
- Switch expressions
- Nullability annotations (`?`, attributes) and analysis
- If you add a place an expression can appear in code, make sure `SpillSequenceSpiller` handles it. Test with a `switch` expression or `stackalloc` in that place.
- If you add a new expression form that requires spilling, test it in the catch filter.

# Misc
- reserved keywords (sometimes contextual)
Expand Down
Loading

0 comments on commit cb3cc96

Please sign in to comment.