File tree Expand file tree Collapse file tree
src/FSharp.SystemTextJson Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -197,7 +197,7 @@ type JsonMapConverter(fsOptions: JsonFSharpOptions) =
197197 | MapFormat.Object -> jsonMapObjectConverter genArgs options
198198 | MapFormat.ArrayOfPairs -> jsonMapArrayOfPairsConverter genArgs
199199 | MapFormat.ObjectOrArrayOfPairs ->
200- if genArgs[ 0 ] = typeof< string> || isWrappedString genArgs[ 0 ] then
200+ if Type .(=)( genArgs[ 0 ], typeof< string>) || isWrappedString genArgs[ 0 ] then
201201 jsonMapObjectConverter genArgs options
202202 else
203203 jsonMapArrayOfPairsConverter genArgs
Original file line number Diff line number Diff line change @@ -92,7 +92,7 @@ let isClass ty =
9292let rec tryGetNullValue ( fsOptions : JsonFSharpOptionsRecord ) ( ty : Type ) : obj voption =
9393 if isNullableUnion ty then
9494 ValueSome null
95- elif ty = typeof< unit> then
95+ elif Type .(=)( ty , typeof< unit>) then
9696 ValueSome()
9797 elif fsOptions.UnionEncoding.HasFlag JsonUnionEncoding.UnwrapOption
9898 && isValueOptionType ty then
@@ -149,7 +149,7 @@ let isWrappedString (ty: Type) =
149149
150150 cases.Length = 1
151151 && let fields = cases[ 0 ]. GetFields() in
152- fields.Length = 1 && fields[ 0 ]. PropertyType = typeof< string>
152+ fields.Length = 1 && Type .(=)( fields[ 0 ]. PropertyType, typeof< string>)
153153
154154type FieldHelper
155155 (
@@ -256,7 +256,7 @@ let getJsonFieldNames (getAttributes: Type -> obj[]) =
256256 |> readOnlyDict
257257
258258let getConverterForDictionaryKey < 'T > ( options : JsonSerializerOptions ) =
259- if typeof< 'T> = typeof< string> then
259+ if Type .(=)( typeof< 'T>, typeof< string>) then
260260 // Pre-8.0, the built-in StringConverter doesn't support {Read|Write}AsPropertyName() correctly.
261261 // See https://github.com/dotnet/runtime/issues/77326
262262 { new JsonConverter< string>() with
You can’t perform that action at this time.
0 commit comments