You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merge remote-tracking branch 'upstream/main' into syntaxtree-search
* upstream/main: (62 commits)
Prevent assert from being hit (dotnet#62366)
Don't offer '??=' for pointer types (dotnet#62476)
Integrate generator times into /reportAnalyzer (dotnet#61661)
Switch to a callback for cleaning up resources instead of passing in an explicit IDisposable. (dotnet#62373)
Filter trees to only those containing global-usings or attributes prior to analyzing them. (dotnet#62444)
Update PublishData.json
Complete 'file' support for `SyntaxGenerator` (dotnet#62413)
Apply changes directly to text buffer (dotnet#62337)
Remove LangVer check from extended nameof binding (dotnet#62339)
Fixed shared project file error (dotnet#62466)
Handle new error codes
Use MSBuid generated property for package path
Exclude BCL libraries from Roslyn vsix
Bump the integration test timeouts a bit
Skip the balanced switch dispatch optimization for patterns on floating-point inputs (dotnet#62322)
Test helpers shouldn't escape quotes by default (dotnet#62321)
Reuse prior TableEntry values in the increment NodeTable builder if possible. (dotnet#62320)
Install 3.1 runtime for SBOM tool
Generate VS SBOM during official build.
Minor refactoring in 'required' handling for override completion (dotnet#62422)
...
Copy file name to clipboardexpand all lines: docs/compilers/CSharp/Compiler Breaking Changes - DotNet 7.md
+14-6
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,18 @@
1
1
# This document lists known breaking changes in Roslyn after .NET 6 all the way to .NET 7.
2
2
3
+
## Types cannot be named `file`
4
+
5
+
***Introduced in Visual Studio 2022 version 17.4.*** Starting in C# 11, types cannot be named `file`. The compiler will report an error on all such type names. To work around this, the type name and all usages must be escaped with an `@`:
6
+
7
+
```csharp
8
+
classfile {} // Error CS9056
9
+
class@file {} // No error
10
+
```
11
+
12
+
This was done as `file` is now a modifier for type declarations.
13
+
14
+
You can learn more about this change in the associated [csharplang issue](https://github.com/dotnet/csharplang/issues/6011).
15
+
3
16
## Required spaces in #line span directives
4
17
5
18
***Introduced in .NET SDK 6.0.400, Visual Studio 2022 version 17.3.***
@@ -83,11 +96,6 @@ Possible workarounds are:
83
96
84
97
1. Rename the type parameter or parameter to avoid shadowing the name from outer scope.
85
98
1. Use a string literal instead of the `nameof` operator.
86
-
1. Downgrade the `<LangVersion>` element to 9.0 or earlier.
87
-
88
-
Note: The break will also apply to C# 10 and earlier when .NET 7 ships, but is
89
-
currently scoped down to users of LangVer=preview.
90
-
Tracked by https://github.com/dotnet/roslyn/issues/60640
91
99
92
100
## Cannot return an out parameter by reference
93
101
@@ -426,4 +434,4 @@ class @required {} // No error
426
434
427
435
This was done as `required` is now a member modifier for properties and fields.
428
436
429
-
You can learn more about this change in the associated [csharplang issue](https://github.com/dotnet/csharplang/issues/3630).
437
+
You can learn more about this change in the associated [csharplang issue](https://github.com/dotnet/csharplang/issues/3630).
0 commit comments