Skip to content

Update closed class from main#83059

Draft
RikkiGibson wants to merge 563 commits intodotnet:features/closed-classfrom
RikkiGibson:update-closed-class-from-main
Draft

Update closed class from main#83059
RikkiGibson wants to merge 563 commits intodotnet:features/closed-classfrom
RikkiGibson:update-closed-class-from-main

Conversation

@RikkiGibson
Copy link
Copy Markdown
Member

@RikkiGibson RikkiGibson commented Apr 3, 2026

Resolved merge conflicts in d904dd7
Updated error codes in test baselines in ef45ef8

Microsoft Reviewers: Open in CodeFlow

333fred and others added 30 commits March 3, 2026 05:33
The nullable walker was missing analysis of the runtime async helper,
which caused several warnings to be missing. This adds support for those
missing warnings.

Relates to test plan dotnet#75960
…ature Status (dotnet#82564)

Updates the reviewer assignment for the Unions feature in `docs/Language
Feature Status.md`, replacing `333fred` with `jjonescz` as the second
reviewer.

<!-- START COPILOT CODING AGENT TIPS -->
---

💡 You can make Copilot smarter by setting up custom instructions,
customizing its development environment and configuring Model Context
Protocol (MCP) servers. Learn more [Copilot coding agent
tips](https://gh.io/copilot-coding-agent-tips) in the docs.

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: phil-allen-msft <32652734+phil-allen-msft@users.noreply.github.com>
… Build ID 2916924 (dotnet#82594)

This is the pull request automatically created by the OneLocBuild task
in the build process to check-in localized files generated based upon
translation source files (.lcl files) handed-back from the downstream
localization pipeline. If there are issues in translations, visit
https://aka.ms/icxLocBug and log bugs for fixes. The OneLocBuild wiki is
https://aka.ms/onelocbuild and the localization process in general is
documented at https://aka.ms/AllAboutLoc.
…otnet#82508)

In dotnet#79964 we [removed a
check](https://github.com/dotnet/roslyn/pull/79964/changes#diff-07399f17a690c95d4e31689e1023676fa4b43d37e86775b6611bd8e1f170de6aL280-L281)
for whether a non-compiler build error should be reported to the Error
List. This PR restores that check. It also adds an in-process cache of
diagnostic descriptors so that it can synchronously determine whether a
diagnostic id is supported.

Fixes dotnet#81109
Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/2695780
[main] Source code updates from dotnet/dotnet


 - Remove unused local function
Allow ExperimentalUrl on syntax kinds and apply it only to transitional kind-taking SyntaxFactory overloads, avoiding broad experimental annotation for existing node APIs.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
When we bind for return type inference, we don't yet know if the body of
the lambda will be a `Task`/`ValueTask`, so we can't say for certain
whether runtime async will be enabled in the lambda. Therefore, when we
come back to do real binding, and we do know for certain that the lambda
is runtime async capable, we need to rebind with runtime async enabled.
Fixes dotnet#82551.

Relates to test plan dotnet#75960
We already have a Linux leg running in helix. The single machine run of
Linux is just to ensure we haven't broken the test runner's ability to
run tests locally. This repurposes it for the Spanish locale tests that
run for each PR.

Also, moves the Windows Spanish CI leg to run on rolling builds.
[main] Update dependencies from dotnet/arcade
…#82629)

Introduce IFSharpInlineHintsService2 to enable F# inline hints providers
to handle displayAllOverride. Update FSharpInlineHintsService to prefer
the new interface if available, with fallback to the legacy interface.
Adjust MEF constructor and GetInlineHintsAsync logic accordingly. Update
public API file to reflect new interface and method. This enhances
flexibility and feature support for F# inline hints in Roslyn.

Fixes dotnet#82614
…dotnet#81994)

- Stop resx source generator from declaring type with original name when
overridden
- Avoid emitting illegal namespace identifiers when resx file is not
under the project directory by using `Link` metadata or removing the
non-relative path.

This change deletes a block of code that is commented as being necessary
to support NativeAOT. I have tested a NativeAOT app with these changes
and it works. The source generator is also producing code more similar
to the old resx SFG, so we should be quite confident it will run
correctly.

Fixes dotnet#81973
Fixes dotnet#81991

---------

Co-authored-by: Joey Robichaud <joseph.robichaud@microsoft.com>
Co-authored-by: Phil Allen <phillipa@microsoft.com>
…ection (dotnet#82609)

When connecting to the compiler server fails due to a timeout, pipe
ownership mismatch, or other exception, the previous
`LogException`/`LogError` calls emitted messages prefixed with `"Error
Error:"` or `"Error:"`. This matches the canonical error pattern that
MSBuild's `Exec` task detects in process output, causing it to surface a
build error — even though these are transient, recoverable conditions
where the compiler falls back gracefully to the command-line tool.

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: jjonescz <3669664+jjonescz@users.noreply.github.com>
[main] Source code updates from dotnet/dotnet
…ported" (dotnet#82638)

Reverts dotnet#82508

---------

Co-authored-by: Jan Jones <janjones@microsoft.com>
dotnet-maestro bot and others added 15 commits April 2, 2026 03:52
[main] Source code updates from dotnet/dotnet
Change TFM from NetRoslynWindowsTests to NetRoslyn. Mark 15 tests as
WindowsOnly:
- 7 deep recursion tests that rely on Windows ~1MB stack size
- 8 JSON parser tests with line-ending-dependent diagnostic offsets

Passed: 27531, Failed: 0, Skipped: 63
###### Microsoft Reviewers: [Open in
CodeFlow](https://microsoft.github.io/open-pr/?codeflow=https://github.com/dotnet/roslyn/pull/83014)

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Fix C# formatting for file-based app directives parsed as
`IgnoredDirectiveTriviaSyntax`.

When the formatter touches a line like:

```csharp
 #:package Newtonsoft.Json@13.0.3
```

Roslyn was rewriting it to:

```csharp
# : package Newtonsoft.Json@13.0.3
```

That breaks file-based app syntax and causes downstream issues such as
loss of project/file-based-app recognition and completion failures.

## Root cause

File-based app directives are represented as
`IgnoredDirectiveTriviaSyntax`, but `StructuredTriviaFormattingRule` did
not preserve spacing for the syntax-significant token sequence:

- `HashToken -> ColonToken`
- `ColonToken -> Content`

As a result, generic punctuation spacing rules inserted spaces around
`:` once the directive line became eligible for formatting.

## Fix

Add a special-case in `StructuredTriviaFormattingRule` to force zero
spaces for:

- `#` followed by `:`
- `:` followed by the directive content

inside `IgnoredDirectiveTriviaSyntax`.

## Tests

Added formatter coverage for file-based app directives:
- unchanged formatting for a normal `#:package ...` directive
- regression test showing that a directive with leading whitespace is
normalized to valid `#:package ...` form instead of `# : package ...`

This should also fix this [vscode-csharp
issue](dotnet/vscode-csharp#8851)
Alternative to dotnet#82973

Part of dotnet/razor#6159 and
dotnet/razor#4539

Razor is adding support for Generate Method
(dotnet/razor#12960) but to do that we need
Roslyn to offer the code action, so that's what this does.
###### Microsoft Reviewers: [Open in
CodeFlow](https://microsoft.github.io/open-pr/?codeflow=https://github.com/dotnet/roslyn/pull/83028)
…et#83024)

Resolves dotnet/vscode-csharp#9130

This does not completely fix the errors, but it prevents the server from
crashing. The root cause of the errors is an invalid URI (see
dotnet/vscode-csharp#9087).

### Scenario
When a request to the server is made for an unparsable URI and we have
no saved language information sent to use via `didOpen`, the server
falls back to trying to find a handler for the method using the default
language.

However, some handlers have no default language handler, for example
Razor's `textDocument/documentColor` handler. If we are unable to
determine the language for a request for this method, the server would
crash as it finds no default language handler.

### Fix
The fix I made here is to not crash the server if we cannot find a
handler for a request. The client still gets an error, but allows server
operations to continue. This seemed appropriate as we do not control the
client(s) and should not completely die if we get bad requests.
###### Microsoft Reviewers: [Open in
CodeFlow](https://microsoft.github.io/open-pr/?codeflow=https://github.com/dotnet/roslyn/pull/83024)
…h(LoadStream) failure (dotnet#83044)

`InvokeUtil.Exec` snapshots `CompilerLoadContext.Assemblies` before
running the test, then asserts the set is unchanged afterward.
`AssertEx` has static fields that lazily initialize DiffPlex on first
use; when that first use fell *between* the snapshot and the final
comparison, DiffPlex (and `Microsoft.Win32.Registry` as a
`netstandard2.0` compat shim on .NET 10) appeared only in the post-test
list, failing the `SetEqual` check. Only `LoadStream` was affected
because the other variants ran in process contexts where a prior test
had already triggered `AssertEx` initialization.

## Changes

- **`InvokeUtil.cs`**: Call
`RuntimeHelpers.RunClassConstructor(typeof(AssertEx).TypeHandle)` before
taking the `compilerContextAssemblies` snapshot, ensuring DiffPlex and
any compat-shim assemblies it pulls in are already present in both sides
of the comparison.

```csharp
// Before (snapshot taken before AssertEx/DiffPlex are initialized)
var loader = new AnalyzerAssemblyLoader(...);
var compilerContextAssemblies = loader.CompilerLoadContext.Assemblies.SelectAsArray(...);

// After (force initialization first so the snapshot includes infrastructure assemblies)
var loader = new AnalyzerAssemblyLoader(...);
RuntimeHelpers.RunClassConstructor(typeof(AssertEx).TypeHandle);
var compilerContextAssemblies = loader.CompilerLoadContext.Assemblies.SelectAsArray(...);
```
###### Microsoft Reviewers: [Open in
CodeFlow](https://microsoft.github.io/open-pr/?codeflow=https://github.com/dotnet/roslyn/pull/83044)

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: jaredpar <146967+jaredpar@users.noreply.github.com>
[main] Source code updates from dotnet/dotnet
`UICultureUtilities.cs` used reflection to discover and invoke the
`CultureInfo.CurrentUICulture` setter (falling back to
`Thread.CurrentThread.CurrentUICulture`) because the setter wasn't
universally available when the code was written. The API is now directly
accessible in .NET Standard 2.0+.

## Changes

- Deleted `TryGetCurrentUICultureSetter` and
`TryGetCurrentThreadUICultureSetter` reflection helpers, the static
constructor, `s_setCurrentUICulture` field, and `currentUICultureName`
constant
- Replaced indirect `s_setCurrentUICulture(value)` calls with
`CultureInfo.CurrentUICulture = value`
- Removed the `null`-setter early-return guard from all three
`WithCurrentUICulture` overloads (no longer needed since the setter is
always available)
- Dropped `using System.Diagnostics.CodeAnalysis` and `using
System.Reflection`

**Before:**
```csharp
// ~100 lines of reflection scaffolding to conditionally find and invoke the setter
private static readonly Action<CultureInfo>? s_setCurrentUICulture;
// ...
s_setCurrentUICulture(savedCulture);
```

**After:**
```csharp
CultureInfo.CurrentUICulture = savedCulture;
```
###### Microsoft Reviewers: [Open in
CodeFlow](https://microsoft.github.io/open-pr/?codeflow=https://github.com/dotnet/roslyn/pull/83038)

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: jaredpar <146967+jaredpar@users.noreply.github.com>
…nes (dotnet#83030)

Fixes dotnet#83029

Should be read commit by commit.

###### Microsoft Reviewers: [Open in
CodeFlow](https://microsoft.github.io/open-pr/?codeflow=https://github.com/dotnet/roslyn/pull/83030)

---------

Co-authored-by: Cyrus Najmabadi <Cyrus Najmabadi>
# Overview
After investigating this issue:
https://developercommunity.visualstudio.com/t/Conditional-breakpoint-is-not-respecting/11063626

I determined that for evaluations inside `ref`-returning frames, the
expression compiler would generate query method signatures indicating
that the return type is `T&` (`ref T`), while the query method itself
still returned `T` (as expected).

In particular, this bug breaks breakpoint conditions in VS; typical
conditions rely on comparisons, which return `Int32` and the debugger
can make the implicit conversion from `Int32` to the method signature
`bool` return type. In `ref`-returning methods, the debugger cannot make
the implicit conversion when the signature indicates `bool&`.

# Details
Clearly this is an oversight on the C# expression compiler side; the VB
EE already handles this correctly (EEMethodSymbol.vb)
```vb
Public Overrides ReadOnly Property ReturnsByRef As Boolean
    Get
        Return False
    End Get
End Property
```

The change is to make `EEMethodSymbol` not inherit `RefKind` and instead
return `RefKind.None`.

# Testing
Added unit test; deployed changes to experimental instance and verified
the linked original issue is fixed.
Co-authored-by: Jason Malinowski <jason@jason-m.com>
@dotnet-policy-service dotnet-policy-service bot added VSCode Needs API Review Needs to be reviewed by the API review council labels Apr 3, 2026
@dotnet dotnet deleted a comment from dotnet-policy-service bot Apr 3, 2026
@RikkiGibson RikkiGibson removed Needs API Review Needs to be reviewed by the API review council VSCode labels Apr 3, 2026
@RikkiGibson RikkiGibson force-pushed the update-closed-class-from-main branch from c95bc1f to ef45ef8 Compare April 6, 2026 19:03
@dotnet-policy-service dotnet-policy-service bot added VSCode Needs API Review Needs to be reviewed by the API review council labels Apr 6, 2026
@dotnet dotnet deleted a comment from dotnet-policy-service bot Apr 6, 2026
@RikkiGibson RikkiGibson removed Needs API Review Needs to be reviewed by the API review council VSCode labels Apr 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.