| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Diff: https://github.com/dotnet/runtime/compare/fdecb6b73237947d1429b5d3de71edea536b5b53..e302d2a27aef2196c8d710752da8b7726c5fe84d From: dotnet/runtime@fdecb6b To: dotnet/runtime@e302d2a [[ commit created by automation ]]
Sorry, something went wrong.
|
This pull request only contains source updates from https://github.com/dotnet/runtime between commits fdecb6b73237947d1429b5d3de71edea536b5b53 and e302d2a27aef2196c8d710752da8b7726c5fe84d. |
Sorry, something went wrong.
/__w/1/s/src/fsharp/src/Compiler/Checking/NicePrint.fs(401,25): error FS0041: A unique overload for method 'TryParse' could not be determined based on type information prior to this program point. A type annotation may be needed.��Known types of arguments: string * NumberStyles * CultureInfo��Candidates:� - Int32.TryParse(s: ReadOnlySpan<char>, style: NumberStyles, provider: IFormatProvider | null, result: byref<int>) : bool� - Int32.TryParse(s: ReadOnlySpan<char>, style: NumberStyles, provider: IFormatProvider | null, result: byref<int>, charsConsumed: byref<int>) : bool� - Int32.TryParse(s: string | null, style: NumberStyles, provider: IFormatProvider | null, result: byref<int>) : bool� - Int32.TryParse(s: string | null, style: NumberStyles, provider: IFormatProvider | null, result: byref<int>, charsConsumed: byref<int>) : bool [/__w/1/s/src/fsharp/src/Compiler/FSharp.Compiler.Service.fsproj::TargetFramework=net11.0] @T-Gro this likely needs reaction to dotnet/runtime#130210 |
Sorry, something went wrong.
|
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 |
Sorry, something went wrong.
|
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). |
Sorry, something went wrong.
Sorry, something went wrong.
|
-- 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 |
Sorry, something went wrong.
…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 T.TryParse(...) given where T : INumberBase<T> |
Sorry, something went wrong.
|
Caution 🛑 Codeflow Paused — Conflict detectedA conflict was detected when trying to update this PR with changes from build 322260 of https://github.com/dotnet/runtime/tree/6c5849144dc8a23aa0760080d6f7784fed60da37. 💡 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. |
Sorry, something went wrong.
Sorry, something went wrong.
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 OverloadResolutionPriorityAttribute (ORPA) which's support incl. multiple outs we could land in F# and it would be a general mechanism, not just a fix for this single scenario. It still relies on that attribute being applied that way in the runtime libraries👍 . C# would not be affected, since with explicit hand-written out .. there is no conflict to resolve. Another option to resolve this particular occasion would be to describe the behavior via a dedicated method name instead of a flag and overloads. |
Sorry, something went wrong.
|
@akoeplinger, this looks ready to approve/merge |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
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
- Subscription: 6458ae35-db00-43d0-af59-e57a01ca3120
- Build: 20260709.17 (322260)
- Date Produced: July 9, 2026 8:07:36 PM UTC
- Commit: 6c5849144dc8a23aa0760080d6f7784fed60da37
- Commit Diff: fdecb6b...6c58491
- Branch: main
Diff the source with this PR branch