Skip to content

Commit

Permalink
adapt for .net 9.0.200
Browse files Browse the repository at this point in the history
  • Loading branch information
pchalamet committed Feb 12, 2025
1 parent 8741ae1 commit 92268ee
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/on-push-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v4.2.0
with:
dotnet-version: 9.0.101
dotnet-version: 9.0.200

- name: Build & Test
run: make test config=Release
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/on-push-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v4.2.0
with:
dotnet-version: 9.0.101
dotnet-version: 9.0.200

- name: Extract Version Suffix
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/on-release-published.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v4.2.0
with:
dotnet-version: 9.0.101
dotnet-version: 9.0.200

- name: Download Release artifacts
uses: robinraju/release-downloader@v1.11
Expand Down
9 changes: 1 addition & 8 deletions src/FSharp.MongoDB.Bson/Serialization/FSharpTypeHelpers.fs
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,4 @@ module private Helpers =
/// Maps a member of a <c>BsonClassMap</c> to a nullable value if possible.
/// </summary>
let mapMemberNullable (memberMap: BsonClassMap) (propertyInfo: PropertyInfo) =
let memberMap = memberMap.MapMember(propertyInfo)
#if !NETSTANDARD2_1
let nrtInfo = nrtContext.Create(propertyInfo)
if nrtInfo.WriteState = NullabilityState.Nullable then
memberMap.SetDefaultValue(null) |> ignore
#else
()
#endif
memberMap.MapMember(propertyInfo) |> ignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ module FSharp =
member _.GetSerializer typ =
let mkSerializer typ =
typ
|> Option.map (fun typ -> System.Activator.CreateInstance typ :?> IBsonSerializer)
|> Option.map (fun typ -> System.Activator.CreateInstance typ |> nonNull :?> IBsonSerializer)
|> Option.toObj

match typ with
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ type FSharpUnionSerializer<'T>() =
let mkClassMapSerializer (caseType:System.Type) =
let classMap = BsonClassMap.LookupClassMap caseType
let serializerType = typedefof<BsonClassMapSerializer<_>>.MakeGenericType [| caseType |]
System.Activator.CreateInstance(serializerType, classMap) :?> IBsonSerializer
System.Activator.CreateInstance(serializerType, classMap) |> nonNull :?> IBsonSerializer

// 8.5.4. Compiled Form of Union Types for Use from Other CLI Languages
// A compiled union type U has [o]ne CLI nested type U.C for each non-null union case C.
Expand Down

0 comments on commit 92268ee

Please sign in to comment.