Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[generator] Work around dotnet/roslyn#55564
Context: dotnet/roslyn#55564 Context: https://discord.com/channels/732297728826277939/732297837953679412/874959446747533323 .NET 6 Preview 7 introduced a C# compiler regression: use of [C#6 string interpolation][0] with `StringBuilder.Append()` when `$(LangVersion)` < 10.0 results in a CS8400 error: error CS8400: Feature 'interpolated string handlers' is not available in C# 8.0. Please use language version 10.0 or greater. Because `azure-pipelines.yaml` specifies `DotNetCoreVersion: 6.0.x`, our CI machines get auto-bumped to .NET 6 Preview 7, causing *all* PR builds to now fail with this CS8400 failure. There are two possible solutions: 1. *Avoid* .NET 6 Preview 7. 2. Remove select use of string interpolation. (1) was initially done on dotnet#865, by using: DotNetCoreVersion: 6.0.100-preview.6.21355.2 However, it's not *all* use of string interpolation which triggers the CS8400 error. It's just use of string interpolation within `StringBuilder.Append()` calls, in 3 locations. Update `RegisterAttr.cs` to use a `(string)` cast with the existing string interpolation use. This works around the CS8400 error. [0]: https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/tokens/interpolated
- Loading branch information