[main] Source code updates from dotnet/runtime - #7617
#7617[main] Source code updates from dotnet/runtime#7617dotnet-maestro[bot] merged 3 commits intomaindotnet/dotnet:mainfrom darc-main-9be1d1d2-5f5d-4fad-9187-7bf8bcc56febdotnet/dotnet:darc-main-9be1d1d2-5f5d-4fad-9187-7bf8bcc56febCopy head branch name to clipboard
Conversation
Diff: https://github.com/dotnet/runtime/compare/fdecb6b73237947d1429b5d3de71edea536b5b53..e302d2a27aef2196c8d710752da8b7726c5fe84d From: dotnet/runtime@fdecb6b To: dotnet/runtime@e302d2a [[ commit created by automation ]]
|
This pull request only contains source updates from https://github.com/dotnet/runtime between commits fdecb6b73237947d1429b5d3de71edea536b5b53 and e302d2a27aef2196c8d710752da8b7726c5fe84d. |
@T-Gro this likely needs reaction to dotnet/runtime#130210 |
|
Ah, that is an unfortunate break in the F# type inference (but understandably something that can occur with any new overload addition) IIRC you can resolve like this if you want to keep the existing 3 line match syntax - match Int32.TryParse(rightMost, NumberStyles.Integer, CultureInfo.InvariantCulture) with
+ match (Int32.TryParse(rightMost, NumberStyles.Integer, CultureInfo.InvariantCulture) : bool * int) with
| true, n -> n
| false, _ -> 0 // looks like it's non-genericand otherwise break it down to: let mutable n = 0
match Int32.TryParse(rightMost, NumberStyles.Integer, CultureInfo.InvariantCulture, &n) with
| true -> n
| false -> 0 |
|
Yeah, it is why we are (from a type-inferred language perspective) often unhappy with any "lets use new overloads as our primary API design technique" in general. I would be happy to change the compiler if there was any indication of the "main" (or OG) overload, but I cannot infer any rule for that unfortunately. Given this doesn`t just break the FSharp compiler but all FSharp users, is there any chance to reconsider the placement of specialized features like this? Given this sits next to a very basic API? e.g. extension methods in a dedicated namespace come to mind. Its not that we are against evolution - but here the "fix" objectively leads to worse F# code even for people not using those new APIs (similar for other scenarios from the past, where a "fix" lead to dropping type inference and annotating parameters). |
|
-- To be clear, I am already working on the change to avoid the F# break here for now, while still allowing the feature to ship. Should have it up shortly |
…to be explicitly implemented to avoid breaking F#
|
Pushed up the commit that makes the relevant APIs explicitly implemented, which should resolve the F# break and still allow the functionality to be accessible via |
|
Caution 🛑 Codeflow Paused — Conflict detectedA conflict was detected when trying to update this PR with changes from build 💡 You can either merge the PR without getting these new updates or manually flow them in and resolve the conflicts so that automated codeflow can resume for this PR. The conflicts in the following files need to be manually resolved:
ℹ️ To resolve the conflicts, please follow these steps:
💡 You may consult the FAQ for more information or tag @dotnet/prodconsvcs for assistance. |
Diff: https://github.com/dotnet/runtime/compare/6c5849144dc8a23aa0760080d6f7784fed60da37..6c5849144dc8a23aa0760080d6f7784fed60da37 From: dotnet/runtime@6c58491 To: dotnet/runtime@6c58491 The following files had conflicts that were resolved by a user: - src/runtime/src/libraries/System.Runtime.Numerics/src/System/Numerics/Complex.cs
|
@tannergooding : Thank you greatly for making a patch for this 👍 . For the long term mechanics: Method resolution in F# cannot make assumptions based on later usage, as that might be type inferred as well. One way to indicate the "default" here would be C# would not be affected, since with explicit hand-written Another option to resolve this particular occasion would be to describe the behavior via a dedicated method name instead of a flag and overloads. |
|
@akoeplinger, this looks ready to approve/merge |

Note
This is a codeflow update. It may contain both source code changes from
the source repo
as well as dependency updates. Learn more here.
This pull request brings the following source code changes
From https://github.com/dotnet/runtime
Diff the source with this PR branch