Skip to content

Conversation

@dotnet-maestro
Copy link
Contributor

@dotnet-maestro dotnet-maestro bot commented Nov 4, 2025

This pull request updates the following dependencies

From https://github.com/dotnet/roslyn

…915.8

On relative base path root
Microsoft.SourceBuild.Intermediate.roslyn , Microsoft.CodeAnalysis , Microsoft.CodeAnalysis.CSharp , Microsoft.Net.Compilers.Toolset From Version 4.12.0-3.25467.18 -> To Version 4.14.0-3.25465.8
Microsoft.CodeAnalysis.Analyzers From Version 3.11.0-beta1.25173.3 -> To Version 3.12.0-beta1.25465.8
@steveisok
Copy link
Member

Failures with Cannot implicitly convert type 'System.ReadOnlySpan<int>' to 'System.Span<int>' seem related.

/cc @jeffhandley

@sbomer
Copy link
Member

sbomer commented Nov 6, 2025

@copilot fix the error:
src/libraries/System.Text.Json/src/System/Text/Json/Document/JsonDocument.MetadataDb.cs(384,39): error CS0029: (NETCORE_ENGINEERING_TELEMETRY=Build) Cannot implicitly convert type 'System.ReadOnlySpan' to 'System.Span'

Copy link
Contributor

Copilot AI commented Nov 6, 2025

@sbomer I've opened a new pull request, #121414, to work on those changes. Once the pull request is ready, I'll request review from you.

…121414)

The Roslyn 4.14.0 compiler update introduced stricter type checking for
`MemoryMarshal.Cast` when called directly on arrays, now returning
`ReadOnlySpan<T>` instead of `Span<T>`.

## Changes

- **JsonDocument.MetadataDb.cs**: Explicitly convert byte array to
`Span<byte>` before casting to `Span<int>` to preserve write access

```csharp
// Before
Span<int> newDbInts = MemoryMarshal.Cast<byte, int>(newDatabase);

// After  
Span<int> newDbInts = MemoryMarshal.Cast<byte, int>(newDatabase.AsSpan());
```

The writable span is required since the code modifies elements via
`newDbInts[i] -= locationOffset`.

<!-- 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] <[email protected]>
Co-authored-by: sbomer <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-codeflow for labeling automated codeflow

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants