Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expression tree vs .NET 9 - compilation error #110592

Open
fandrei opened this issue Dec 10, 2024 · 4 comments
Open

Expression tree vs .NET 9 - compilation error #110592

fandrei opened this issue Dec 10, 2024 · 4 comments
Labels
area-System.Linq.Expressions untriaged New issue has not been triaged by the area owner

Comments

@fandrei
Copy link
Contributor

fandrei commented Dec 10, 2024

Description

The following code compiles with .NET 8, but not with .NET 9.

Expression<Func<string>> expression = () => string.Join("", "");

Reproduction Steps

compile

Expected behavior

no errors

Actual behavior

Compilation errors:

Expression tree cannot contain value of ref struct or restricted type 'ReadOnlySpan'.
An expression tree may not contain an expanded form of non-array params collection parameter.

Regression?

worked in .NET 8

Known Workarounds

No response

Configuration

No response

Other information

No response

@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label Dec 10, 2024
Copy link
Contributor

Tagging subscribers to this area: @cston
See info in area-owners.md if you want to be subscribed.

@cston
Copy link
Member

cston commented Dec 10, 2024

See also discussion of the breaking change in C# LDM-2024-06-17.

@stephentoub
Copy link
Member

cc: @jaredpar, @jjonescz, @333fred

@cston
Copy link
Member

cston commented Dec 12, 2024

Logged breaking change issue: dotnet/docs#43949

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-System.Linq.Expressions untriaged New issue has not been triaged by the area owner
Projects
None yet
Development

No branches or pull requests

3 participants