Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #69744 from dotnet/merges/main-to-release/dev17.8
Merge main into release/dev17.8 for snap
- Loading branch information
Showing
1,074 changed files
with
74,542 additions
and
24,053 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
docs/compilers/CSharp/Compiler Breaking Changes - DotNet 8.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# This document lists known breaking changes in Roslyn after .NET 7 all the way to .NET 8. | ||
|
||
## `ref` arguments can be passed to `in` parameters | ||
|
||
***Introduced in Visual Studio 2022 version 17.8p2*** | ||
|
||
Feature [`ref readonly` parameters](https://github.com/dotnet/csharplang/issues/6010) relaxed overload resolution | ||
allowing `ref` arguments to be passed to `in` parameters when `LangVersion` is set to 12 or later. | ||
This can lead to behavior or source breaking changes: | ||
|
||
```cs | ||
var i = 5; | ||
System.Console.Write(new C().M(ref i)); // prints "E" in C# 11, but "C" in C# 12 | ||
System.Console.Write(E.M(new C(), ref i)); // workaround: prints "E" always | ||
class C | ||
{ | ||
public string M(in int i) => "C"; | ||
} | ||
static class E | ||
{ | ||
public static string M(this C c, ref int i) => "E"; | ||
} | ||
``` | ||
|
||
```cs | ||
var i = 5; | ||
System.Console.Write(C.M(null, ref i)); // prints "1" in C# 11, but fails with an ambiguity error in C# 12 | ||
System.Console.Write(C.M((I1)null, ref i)); // workaround: prints "1" always | ||
interface I1 { } | ||
interface I2 { } | ||
static class C | ||
{ | ||
public static string M(I1 o, ref int x) => "1"; | ||
public static string M(I2 o, in int x) => "2"; | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.