-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
[main] Update dependencies from dotnet/roslyn #100186
[main] Update dependencies from dotnet/roslyn #100186
Conversation
Microsoft.SourceBuild.Intermediate.roslyn , Microsoft.CodeAnalysis , Microsoft.CodeAnalysis.CSharp , Microsoft.Net.Compilers.Toolset From Version 4.10.0-2.24114.13 -> To Version 4.10.0-3.24172.13
@jaredpar Roslyn update introduced a build break in a very old
|
Microsoft.SourceBuild.Intermediate.roslyn , Microsoft.CodeAnalysis , Microsoft.CodeAnalysis.CSharp , Microsoft.Net.Compilers.Toolset From Version 4.10.0-2.24114.13 -> To Version 4.10.0-3.24174.2
class C
{
static object M1()
{
var a = "";
dynamic da = a;
return M2(da) as object;
}
static void M2(string s) { }
} This scenario behaves differently after Params Collections - Adjust binding in presence of dynamic arguments (71421). There's a new error: // (7,16): error CS0039: Cannot convert type 'void' to 'object' via a reference conversion, boxing conversion, unboxing conversion, wrapping conversion, or null type conversion
// return M2(da) as object;
Diagnostic(ErrorCode.ERR_NoExplicitBuiltinConv, "M2(da) as object").WithArguments("void", "object").WithLocation(7, 16) @AlekseyTs is that expected? |
Microsoft.SourceBuild.Intermediate.roslyn , Microsoft.CodeAnalysis , Microsoft.CodeAnalysis.CSharp , Microsoft.Net.Compilers.Toolset From Version 4.10.0-2.24114.13 -> To Version 4.10.0-3.24175.2
I would say yes. There is only one applicable candidate. Therefore, compile time resolution is performed. Therefore, result type of the invocation is not |
@AlekseyTs can the old behavior be achieved by adding a second overload here to force the more dynamic interpretation? Example: static void M2(int i) { } |
|
I assume this no longer compiling is also considered a bug fix? public class C {
public void M(MyClass c) {
dynamic d = 4;
c[3, d] = 42;
}
}
public class MyClass
{
public dynamic this[int x, dynamic d] => d;
} It previously compiled, but now it fails to compile with:
|
(I pushed a commit to workaround the dynamic changes to the other PR.) |
A language design change. |
Closing in favor of #98559 |
This pull request updates the following dependencies
From https://github.com/dotnet/roslyn