-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Language changes are breaking real-world use of dynamic #72750
Comments
…andidate. Meant to mitigate breaking changes like dotnet/roslyn#72750.
…have `dynamic` result if their dynamic binding succeeded in C# 12 Fixes dotnet#72750. Corresponding spec update - dotnet/csharplang#8027
… local functions, extension methods or expanded non-array params cases. Related to dotnet#72750. This is an alternative limited approach for QB mode.
…c` arguments (dotnet#72964) Fixes dotnet#72750. For C# 12 language version: behavior of the compiler in regards to deciding between whether binding should be static or dynamic is the same as behavior of C# 12 compiler. As a result, for affected scenarios, what used to have `dynamic` type in C# 12 compiler will have `dynamic` type when C# 12 language version is targeted. For newer language versions: invocations statically bound in presence of dynamic arguments should have dynamic result if their dynamic binding succeeded in C# 12. Corresponding spec update - dotnet/csharplang#8027 at commit 8. Related to dotnet#33011, dotnet#72906, dotnet#72912, dotnet#72913, dotnet#72914, dotnet#72916, dotnet#72931.
Restore dynamic as result type of some operations involving dynamic arguments (#72964) Fixes #72750. For C# 12 language version: behavior of the compiler in regards to deciding between whether binding should be static or dynamic is the same as behavior of C# 12 compiler. As a result, for affected scenarios, what used to have dynamic type in C# 12 compiler will have dynamic type when C# 12 language version is targeted. For newer language versions: invocations statically bound in presence of dynamic arguments should have dynamic result if their dynamic binding succeeded in C# 12. Corresponding spec update - dotnet/csharplang#8027 at commit 8. Related to #33011, #72906, #72912, #72913, #72914, #72916, #72931.
Will this also fix the fact that old versions of VS will compile https://dotnetfiddle.net/OdQkAQ as a legacy .NET Framework 4.8 console app but Version 17.10.0 Preview 4.0 will not? Specifically
used to compile, now it doesn't (CS8957) if |
It is not clear to me how this is related to dynamic invocations. If it is, more details might help to give the answer. |
Specifically
used to compile, now it doesn't (CS8957) if To repro - copy and paste the code from the dotnetfiddle into I suppose I am trying to clarify if this is a known bug or not. Apologies if this is unrelated. |
This looks like the same issue and I think this scenario will be fixed as well. As a temporary workaround you can convert result of |
… local functions or language version past C# 12. Related to dotnet#72750.
… local functions (#73314) Fixes #72750. This implements the latest LDM decision. In order to make sure all artifacts of the previous fix (#72964) were removed, I reverted all implementation (but not test changes) from that PR by using 'git revert`. All cleanups/refactorings that are still relevant were manually ported back.
Version Used:
Version 17.10.0 Preview 3.0 [34721.271.main]
Steps to Reproduce:
Expected Behavior:
Previously this compiled fine.
SharpLab
Actual Behavior:
Now it fails to compile:
After the recent changes around
dynamic
, the type ofresult
is nowobject
whereas previously it wasdynamic
.[jcouv:] Relates to #71421
The text was updated successfully, but these errors were encountered: