Skip to content

Commit

Permalink
Merge main to VBOverloadResolutionPriority (#76392)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlekseyTs authored Dec 12, 2024
2 parents efeb43a + c30de30 commit f87dcd8
Show file tree
Hide file tree
Showing 1,295 changed files with 69,368 additions and 49,964 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ UnitTestResults.html
*.nuget.props
*.nuget.targets
project.lock.json
msbuild.binlog
*.binlog
*.project.lock.json

*_i.c
Expand Down
7 changes: 0 additions & 7 deletions Roslyn.sln
Original file line number Diff line number Diff line change
Expand Up @@ -539,8 +539,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CodeAnalysis.Exte
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CodeAnalysis.ExternalAccess.EditorConfigGenerator", "src\VisualStudio\ExternalAccess\EditorConfigGenerator\Microsoft.CodeAnalysis.ExternalAccess.EditorConfigGenerator.csproj", "{09AEDEE4-6358-47C9-8022-3BD37A518070}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IntegrationTestBuildProject", "src\VisualStudio\IntegrationTest\IntegrationTestBuildProject.csproj", "{4D9D7A28-BB44-4F3F-81DA-14F39B853718}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CodeAnalysis.Features.DiagnosticsTests.Utilities", "src\Features\DiagnosticsTestUtilities\Microsoft.CodeAnalysis.Features.DiagnosticsTests.Utilities.csproj", "{5BABC440-4F1B-46E8-9068-DD7F02ED25D3}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CodeAnalysis.Features.Test.Utilities", "src\Features\TestUtilities\Microsoft.CodeAnalysis.Features.Test.Utilities.csproj", "{5762E483-75CE-4328-A410-511F30737712}"
Expand Down Expand Up @@ -1365,10 +1363,6 @@ Global
{09AEDEE4-6358-47C9-8022-3BD37A518070}.Debug|Any CPU.Build.0 = Debug|Any CPU
{09AEDEE4-6358-47C9-8022-3BD37A518070}.Release|Any CPU.ActiveCfg = Release|Any CPU
{09AEDEE4-6358-47C9-8022-3BD37A518070}.Release|Any CPU.Build.0 = Release|Any CPU
{4D9D7A28-BB44-4F3F-81DA-14F39B853718}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4D9D7A28-BB44-4F3F-81DA-14F39B853718}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4D9D7A28-BB44-4F3F-81DA-14F39B853718}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4D9D7A28-BB44-4F3F-81DA-14F39B853718}.Release|Any CPU.Build.0 = Release|Any CPU
{5BABC440-4F1B-46E8-9068-DD7F02ED25D3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5BABC440-4F1B-46E8-9068-DD7F02ED25D3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5BABC440-4F1B-46E8-9068-DD7F02ED25D3}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down Expand Up @@ -1652,7 +1646,6 @@ Global
{B1481D94-682E-46EC-ADBE-A16EB46FEEE9} = {55A62CFA-1155-46F1-ADF3-BEEE51B58AB5}
{5E8FB6D6-6C5C-42E6-9220-1EAA7ED9BCAD} = {1AE9182D-B03E-4B00-B32E-37AE01715F57}
{09AEDEE4-6358-47C9-8022-3BD37A518070} = {5880FECB-91F1-4AB8-8726-75EAFA8A918E}
{4D9D7A28-BB44-4F3F-81DA-14F39B853718} = {CC126D03-7EAC-493F-B187-DCDEE1EF6A70}
{5BABC440-4F1B-46E8-9068-DD7F02ED25D3} = {3E5FE3DB-45F7-4D83-9097-8F05D3B3AEC6}
{5762E483-75CE-4328-A410-511F30737712} = {3E5FE3DB-45F7-4D83-9097-8F05D3B3AEC6}
{6D819E80-BA2F-4317-8368-37F8F4434D3A} = {806F0C6F-3640-4C92-8D55-6767B1535467}
Expand Down
1 change: 1 addition & 0 deletions SpellingExclusions.dic
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
awaitable
Refactorings
Infos
cref
1 change: 1 addition & 0 deletions azure-pipelines-pr-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -339,5 +339,6 @@ extends:
# Symbol validation is not entirely reliable as of yet, so should be turned off until
# https://github.com/dotnet/arcade/issues/2871 is resolved.
enableSymbolValidation: false
enableSigningValidation: false
enableSourceLinkValidation: false
SDLValidationParameters: false
10 changes: 7 additions & 3 deletions docs/Language Feature Status.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,22 @@ efforts behind them.

| Feature | Branch | State | Developer | Reviewer | IDE Buddy | LDM Champ |
| ------- | ------ | ----- | --------- | -------- | --------- | --------- |
| [Default in deconstruction](https://github.com/dotnet/roslyn/pull/25562) | [decon-default](https://github.com/dotnet/roslyn/tree/features/decon-default) | [In Progress](https://github.com/dotnet/roslyn/issues/25559) | [jcouv](https://github.com/jcouv) | [gafter](https://github.com/gafter) | | [jcouv](https://github.com/jcouv) |
| [Roles/Extensions](https://github.com/dotnet/csharplang/issues/5497) | [roles](https://github.com/dotnet/roslyn/tree/features/roles) | [In Progress](https://github.com/dotnet/roslyn/issues/66722) | [jcouv](https://github.com/jcouv) | [AlekseyTs](https://github.com/AlekseyTs), [jjonescz](https://github.com/jjonescz) | [CyrusNajmabadi](https://github.com/CyrusNajmabadi) | [MadsTorgersen](https://github.com/MadsTorgersen) |
| String literals in data section as UTF8 | [PR](https://github.com/dotnet/roslyn/pull/76036) | [In Progress](https://github.com/dotnet/roslyn/issues/76234) | [jjonescz](https://github.com/jjonescz) | [AlekseyTs](https://github.com/AlekseyTs), [jcouv](https://github.com/jcouv) | N/A | N/A |
| Runtime Async | [features/runtime-async](https://github.com/dotnet/roslyn/tree/features/runtime-async) | [In Progress](https://github.com/dotnet/roslyn/issues/75960) | [333fred](https://github.com/333fred) | [jcouv](https://github.com/jcouv), [RikkiGibson](https://github.com/RikkiGibson) | | |
| [Simple lambda parameters with modifiers](https://github.com/dotnet/csharplang/blob/main/proposals/simple-lambda-parameters-with-modifiers.md) | [PR](https://github.com/dotnet/roslyn/pull/75400) | [In Progress](https://github.com/dotnet/roslyn/issues/76298) | [CyrusNajmabadi](https://github.com/CyrusNajmabadi) | [jjonescz](https://github.com/jjonescz), [cston](https://github.com/cston) | [CyrusNajmabadi](https://github.com/CyrusNajmabadi) | [CyrusNajmabadi](https://github.com/CyrusNajmabadi) |
| [Null-conditional assignment](https://github.com/dotnet/csharplang/issues/6045) | [null-conditional-assignment](https://github.com/dotnet/roslyn/tree/features/null-conditional-assignment) | [In Progress](https://github.com/dotnet/roslyn/issues/75554) | [RikkiGibson](https://github.com/RikkiGibson) | [cston](https://github.com/cston), [jjonescz](https://github.com/jjonescz) | TBD | [RikkiGibson](https://github.com/RikkiGibson) |
| [Extensions](https://github.com/dotnet/csharplang/issues/8697) | [extensions](https://github.com/dotnet/roslyn/tree/features/extensions) | [In Progress](https://github.com/dotnet/roslyn/issues/76130) | [jcouv](https://github.com/jcouv), [AlekseyTs](https://github.com/AlekseyTs) | [jjonescz](https://github.com/jjonescz), TBD | [CyrusNajmabadi](https://github.com/CyrusNajmabadi) | [MadsTorgersen](https://github.com/MadsTorgersen) |
| [Dictionary expressions](https://github.com/dotnet/csharplang/issues/8659) | [dictionary-expressions](https://github.com/dotnet/roslyn/tree/features/dictionary-expressions) | [In Progress](https://github.com/dotnet/roslyn/issues/76310) | [333fred](https://github.com/333fred), [jcouv](https://github.com/jcouv) | [cston](https://github.com/cston), [CyrusNajmabadi](https://github.com/CyrusNajmabadi) | [CyrusNajmabadi](https://github.com/CyrusNajmabadi) | [CyrusNajmabadi](https://github.com/CyrusNajmabadi) |
| [`field` keyword in properties](https://github.com/dotnet/csharplang/issues/140) | [field-keyword](https://github.com/dotnet/roslyn/tree/features/field-keyword) | [Merged into 17.12p3](https://github.com/dotnet/roslyn/issues/57012) | [Youssef1313](https://github.com/Youssef1313), [cston](https://github.com/cston) | [333fred](https://github.com/333fred), [RikkiGibson](https://github.com/RikkiGibson) | [CyrusNajmabadi](https://github.com/CyrusNajmabadi) | [CyrusNajmabadi](https://github.com/CyrusNajmabadi) |
| [First-class Span Types](https://github.com/dotnet/csharplang/issues/7905) | [FirstClassSpan](https://github.com/dotnet/roslyn/tree/features/FirstClassSpan) | [Merged into 17.13p1](https://github.com/dotnet/roslyn/issues/73445) | [jjonescz](https://github.com/jjonescz) | [cston](https://github.com/cston), [333fred](https://github.com/333fred) | | [333fred](https://github.com/333fred), [stephentoub](https://github.com/stephentoub) |
| [Unbound generic types in `nameof`](https://github.com/dotnet/csharplang/issues/8480) | [PR](https://github.com/dotnet/roslyn/pull/75368) | [In Progress](https://github.com/dotnet/roslyn/pull/75368) | [CyrusNajmabadi](https://github.com/CyrusNajmabadi) | [jcouv](https://github.com/jcouv) | [CyrusNajmabadi](https://github.com/CyrusNajmabadi) | [CyrusNajmabadi](https://github.com/CyrusNajmabadi) |
| [Unbound generic types in `nameof`](https://github.com/dotnet/csharplang/issues/8480) | [PR](https://github.com/dotnet/roslyn/pull/75368) | [Merged into 17.13p2](https://github.com/dotnet/roslyn/pull/75368) | [CyrusNajmabadi](https://github.com/CyrusNajmabadi) | [jcouv](https://github.com/jcouv), [AlekseyTs](https://github.com/AlekseyTs) | [CyrusNajmabadi](https://github.com/CyrusNajmabadi) | [CyrusNajmabadi](https://github.com/CyrusNajmabadi) |

# Working Set VB

| Feature | Branch | State | Developer | Reviewer | IDE Buddy | LDM Champ |
| ------- | ------ | ----- | --------- | -------- | --------- | --------- |
| Recognizing 'unmanaged' constraint | main | [Merged into 17.13 P2](https://github.com/dotnet/roslyn/pull/75665) | [AlekseyTs](https://github.com/AlekseyTs) | [cston](https://github.com/cston), [333fred](https://github.com/333fred) | (no IDE impact) | [jaredpar](https://github.com/jaredpar) |
| Overload Resolution Priority | [features/VBOverloadResolutionPriority](https://github.com/dotnet/roslyn/tree/features/VBOverloadResolutionPriority) | In Progress | [AlekseyTs](https://github.com/AlekseyTs) | [333fred](https://github.com/333fred), [cston](https://github.com/cston) | (no IDE impact) | [333fred](https://github.com/333fred) |


# C# 13.0
Expand Down
29 changes: 29 additions & 0 deletions docs/compilers/CSharp/Compiler Breaking Changes - DotNet 10.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,32 @@ class C
}
}
```

## Set state of enumerator object to "after" during disposal

***Introduced in Visual Studio 2022 version 17.13***

The state machine for enumerators incorrectly allowed resuming execution after the enumerator was disposed.
Now, `MoveNext()` on a disposed enumerator properly returns `false` without executing any more user code.

```csharp
var enumerator = C.GetEnumerator();

Console.Write(enumerator.MoveNext()); // prints True
Console.Write(enumerator.Current); // prints 1
enumerator.Dispose();

Console.Write(enumerator.MoveNext()); // now prints False
class C
{
public static IEnumerator<int> GetEnumerator()
{
yield return 1;
Console.Write("not executed after disposal")
yield return 2;
}
}
```

21 changes: 14 additions & 7 deletions docs/compilers/CSharp/Runtime Async Design.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,22 @@ public static class RuntimeHelpers
}
```

Additionally, we use the following helper attributes to indicate information to the runtime. If these attributes are not present in the reference assemblies, we will generate them; the runtime matches by full
name, not by type identity, so we do not need to care about using the "canonical" versions.
We presume the following `MethodImplOptions` bit is present. This is used to indicate to the JIT that it should generate an async state machine for the method.

```cs
namespace System.Runtime.CompilerServices;

// Used to tell the runtime to generate the async state machinery for this method
[AttributeUsage(AttributeTargets.Method)]
public class RuntimeAsyncMethodAttribute() : Attribute();
public enum MethodImplOptions
{
Async = 1024
}
```

Additionally, we use the following helper type to indicate information to the runtime. If this type is not present in the reference assemblies, we will generate it; the runtime matches by full
name, not by type identity, so we do not need to care about using the "canonical" version.

```cs
namespace System.Runtime.CompilerServices;

// Used to mark locals that should be hoisted to the generated async closure. Note that the runtime does not guarantee that all locals marked with this modreq will be hoisted; if it can prove that it
// doesn't need to hoist a variable, it may avoid doing so.
Expand All @@ -67,7 +74,7 @@ public class RuntimeAsyncMethodGenerationAttribute(bool runtimeAsync) : Attribut

## Transformation strategy

As mentioned previously, we try to expose as little of this to initial binding as possible. The one major exception to this is our handling of the `RuntimeAsyncMethodAttribute`; we do not let this be applied to
As mentioned previously, we try to expose as little of this to initial binding as possible. The one major exception to this is our handling of the `MethodImplOption.Async`; we do not let this be applied to
user code, and will issue an error if a user tries to do this by hand.

Compiler generated async state machines and runtime generated async share some of the same building blocks. Both need to have `await`s with in `catch` and `finally` blocks rewritten to pend the exceptions,
Expand Down Expand Up @@ -98,7 +105,7 @@ async Task M()
```

```cs
[RuntimeAsyncMethod, Experimental]
[MethodImpl(MethodImplOptions.Async), Experimental]
Task M()
{
// ... see lowering strategy for each kind of await below ...
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Breaking changes in Roslyn after .NET 9.0.100 through .NET 10.0.100

This document lists known breaking changes in Roslyn after .NET 9 general release (.NET SDK version 9.0.100) through .NET 10 general release (.NET SDK version 10.0.100).

## Set state of enumerator object to "after" during disposal

***Introduced in Visual Studio 2022 version 17.13***

The state machine for enumerators incorrectly allowed resuming execution after the enumerator was disposed.
Now, `MoveNext()` on a disposed enumerator properly returns `false` without executing any more user code.

```vb
Imports System
Imports System.Collections.Generic

Module Program
Sub Main()
Dim enumerator = C.GetEnumerator()

Console.Write(enumerator.MoveNext()) ' prints True
Console.Write(enumerator.Current) ' prints 1

enumerator.Dispose()

Console.Write(enumerator.MoveNext()) ' now prints False
End Sub
End Module

Class C
Public Shared Iterator Function GetEnumerator() As IEnumerator(Of Integer)
Yield 1
Console.Write("not executed after disposal")
Yield 2
End Function
End Class
```

4 changes: 4 additions & 0 deletions docs/contributing/Compiler Test Plan.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ This document provides guidance for thinking about language interactions and tes
- Performance and stress testing
- Can build VS
- Check that `Obsolete` is honored for members used in binding/lowering
- LangVersion

# Type and members
- Access modifiers (public, protected, internal, protected internal, private protected, private), static, ref
Expand All @@ -51,6 +52,9 @@ This document provides guidance for thinking about language interactions and tes
- events (including add/remove accessors)
- Parameter modifiers: ref, out, in, ref readonly, params (for array, for non-array)
- Attributes (including generic attributes and security attributes)
- Compiler-recognized attributes should not have any effect in earlier LangVersions,
except a LangVersion error should be reported when functionality depending on the attribute is used
(for example, InlineArray conversion to Span).
- Generics (type arguments, variance, constraints including `class`, `struct`, `new()`, `unmanaged`, `notnull`, types and interfaces with nullability)
- Default and constant values
- Partial classes
Expand Down
19 changes: 19 additions & 0 deletions docs/contributing/Powershell Guidelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,22 @@ in source and unified build. Until that moves to `pwsh` our scripts need to stay

The exception is that our VS Code helper scripts should use `pwsh`. That is not a part of our
infrastructure and needs to run cross platform hence `pwsh` is appropriate.

### Supporting .cmd file

Consider adding a `.cmd` file that calls the `.ps1` file. This is to support users who are not
running a powershell shell. It also helps with ensuring the script is run locally the same it is
run in CI by controlling the powershell used to invoke the script.

test.cmd

```cmd
@echo off
set PSMODULEPATH=
powershell -noprofile -ExecutionPolicy Unrestricted -file "%~dp0\test.ps1" %*
```

Note: the `PSMODULEPATH` is cleared to ensure a pwsh shell [does not interfere][psmodulepath]
with launching powershell.

[psmodulepath]: https://github.com/PowerShell/PowerShell/discussions/24630
17 changes: 17 additions & 0 deletions docs/wiki/Analyzer-Runner.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Analyzer Runner
-------------

AnalyzerRunner currently exists as part of the Roslyn source code.

## Steps to run:

1. Check out the latest main branch from dotnet/roslyn
2. Run Restore.cmd to restore NuGet packages
3. Build Roslyn.sln in the Release configuration, either within Visual Studio or by running Build.cmd -release
4. Set AnalyzerRunner as the startup project
5. Select the launch configuration (several are specified in launchProperties.json but you can create a new one or modify an existing one)
6. Run AnalyzerRunner with Ctrl+F5 or on the command line




2 changes: 2 additions & 0 deletions docs/wiki/NuGet-packages.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ Below are the versions of the language available in the NuGet packages. Remember
- Version `4.8` includes C# 12.0 (Visual Studio 2022 version 17.8, .NET 8)
- Version `4.9.2` includes C# 12.0 (Visual Studio 2022 version 17.9, .NET 8)
- Version `4.10` includes C# 12.0 (Visual Studio 2022 version 17.10, .NET 8)
- Version `4.11` includes C# 12.0 (Visual Studio 2022 version 17.11, .NET 8)
- Version `4.12` includes C# 13.0 (Visual Studio 2022 version 17.12, .NET 9)

See the [history of C# language features](https://github.com/dotnet/csharplang/blob/main/Language-Version-History.md) for more details.

Expand Down
Loading

0 comments on commit f87dcd8

Please sign in to comment.