feat: Support unit16, char, sbyte, uint[32]#29
Conversation
| [<MeasureAnnotatedAbbreviation>] type DateOnly<[<Measure>] 'm> = DateOnly | ||
| [<MeasureAnnotatedAbbreviation>] type TimeOnly<[<Measure>] 'm> = TimeOnly | ||
| #else | ||
| [<MeasureAnnotatedAbbreviation>] type uint32<[<Measure>] 'm> = uint32 |
There was a problem hiding this comment.
It looks like the uint alias and the ability to support for UOM in FSharp.Core wasn't added until around F# 5. To work around this I think we need to use conditional compilation to add support for uint32 prior to this point in time hence the #else in the preprocessor directive.
I feel like this might not be the most accurate preprocessor directive to use though. So if anyone knows of a more F# language version specific one that we could use please let me know. I kinda wanted to use FSHARP5_OR_GREATER but couldn't find a reference for any commonly defined F# specific directives.
| <PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" /> | ||
| <PackageReference Include="FSharp.Core" Version="4.3.4" /> | ||
| <PackageReference Condition=" '$(TargetFramework)' == 'netstandard2.0' " Include="FSharp.Core" Version="4.3.4" /> | ||
| <PackageReference Condition=" '$(TargetFramework)' == 'net6.0' " Include="FSharp.Core" Version="6.0.7" /> |
There was a problem hiding this comment.
Need to target a newer version of FSharp.Core to pick up the uint alias. Again, I chose to do this when compiling for net6.0 as it felt like it was then safe to assume we could use this later version. If that's not acceptable or if there's a better condition to target than just net6.0 let me know.
eb61d74 to
896598c
Compare
896598c to
89b68a5
Compare
|
@eiriktsarpalis Not sure who releases and how but this seems pretty close to releasable? |
|
Any of the mentioned version are out of support for a long time, I don't think this is still relevant? |
|
@T-Gro sorry for being cryptic and not doing more homework. This PR proposes to multi-target net6.0 and ns2.0 and is just filling out the set with new types in newer SDKs i.e. Half I was doing pretty indiscriminate atting in the hopes that someone off the top of their head might have a combined list of relevant System.* types and/or F# aliases that have come into play since the last release (which was some time ago). My main motivation is just to clear down the PR list given there's nothing complex here and it's annoying for people to have to pollyfill things like this in their apps even if it's not hard. That and the fact that various package scanners can flag packages purely based on age, so having a new release would be helpful as a soft signal that UMX has not been either outlawed or superseded by an alternate technique and/or in-the-box support in FSharp.Core. @Choc13 The net6.0 can easily take a dependency on e.g. SDK 10.x, and I think it's fine to add shimming to let people express If anyone has the time or interest to get do a round of work to get it to a point where they're happy with it, I'll do my best to get and/or nudge someone into getting it merged and released quickly. |
Based on #28 and the desire to support UOM for
uint32I've added UOM for all missing basic CLR types (exceptnativeintandunativeint).