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

The compiler does not flag the code as an error when missing parentheses for extension methods that embed string interpolation #12547

Open
Nora-Zhou01 opened this issue Nov 26, 2024 · 1 comment
Labels
💥 regression-release Regression from a public release untriaged The team needs to look at this issue in the next triage

Comments

@Nora-Zhou01
Copy link
Member

.NET version

.NET SDK 10.0.100-alpha.1.24573.1

Did it work in .NET Framework?

Yes

Did it work in any of the earlier releases of .NET Core or .NET 5+?

Yes, it's a regression issue, it works in .NET 5.0, but does not work in .NET 6.0 and latest 10.0.

Issue description

When miss the parentheses for an extension method that embeds string interpolation, the compiler does not flag the code as an error and the code compiles without errors

.NET 10.0 (.NET 8.0 and .NET 9.0 with the same results)

Image

.NET 7.0 (.NET 6.0 results are the same)

Image

.NET 5.0

Image

Steps to reproduce

  1. Launch the StringInterpolationFeature.zip project
  2. View Test.cs code

More info:
The initial feedback ticket is: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/2307287

@Nora-Zhou01 Nora-Zhou01 added untriaged The team needs to look at this issue in the next triage 💥 regression-release Regression from a public release labels Nov 26, 2024
@merriemcgaw
Copy link
Member

This looks like a potential language issue, so we're moving this over to Roslyn to see if it looks familiar to them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💥 regression-release Regression from a public release untriaged The team needs to look at this issue in the next triage
Projects
None yet
Development

No branches or pull requests

2 participants