@@ -334,6 +334,7 @@ module Reflection =
334334 | Fable.LambdaType( argType, returnType) -> genericTypeInfo " lambda" [ argType; returnType ]
335335 | Fable.DelegateType( argTypes, returnType) -> genericTypeInfo " delegate" [ yield ! argTypes; yield returnType ]
336336 | Fable.Tuple( genArgs, _) -> genericTypeInfo " tuple" genArgs
337+ | Fable.Nullable( genArg, isStruct) -> transformTypeInfoFor purpose com ctx r genMap genArg
337338 | Fable.Option( genArg, _) -> genericTypeInfo " option" [ genArg ]
338339 | Fable.Array( genArg, _) -> genericTypeInfo " array" [ genArg ]
339340 | Fable.List genArg -> genericTypeInfo " list" [ genArg ]
@@ -495,6 +496,7 @@ module Reflection =
495496 | Fable.MetaType -> jsInstanceof ( libValue com ctx " Reflection" " TypeInfo" ) expr
496497 | Fable.Option _ -> warnAndEvalToFalse " options" // TODO
497498 | Fable.GenericParam _ -> warnAndEvalToFalse " generic parameters"
499+ | Fable.Nullable( genArg, _ isStruct) -> transformTypeTest com ctx range expr genArg
498500 | Fable.DeclaredType( ent, genArgs) ->
499501 match ent.FullName with
500502 | Types.idisposable ->
@@ -609,6 +611,7 @@ module Annotation =
609611 | Fable.Regex -> makeAliasTypeAnnotation com ctx " RegExp"
610612 | Fable.Number( BigInt, _) -> makeAliasTypeAnnotation com ctx " bigint"
611613 | Fable.Number( kind, _) -> makeNumericTypeAnnotation com ctx kind
614+ | Fable.Nullable( genArg, _) -> makeNullableTypeAnnotation com ctx genArg
612615 | Fable.Option( genArg, _) -> makeOptionTypeAnnotation com ctx genArg
613616 | Fable.Tuple( genArgs, _) -> makeTupleTypeAnnotation com ctx genArgs
614617 | Fable.Array( genArg, kind) -> makeArrayTypeAnnotation com ctx genArg kind
@@ -693,7 +696,7 @@ module Annotation =
693696 makeFableLibImportTypeAnnotation com ctx [] moduleName typeName
694697
695698 let makeNullableTypeAnnotation com ctx genArg =
696- makeFableLibImportTypeAnnotation com ctx [ genArg ] " Option " " Nullable"
699+ makeFableLibImportTypeAnnotation com ctx [ genArg ] " Util " " Nullable"
697700
698701 let makeOptionTypeAnnotation com ctx genArg =
699702 makeFableLibImportTypeAnnotation com ctx [ genArg ] " Option" " Option"
@@ -881,8 +884,6 @@ module Annotation =
881884
882885 let makeEntityTypeAnnotation com ctx genArgs ( ent : Fable.Entity ) =
883886 match genArgs, ent with
884- | [ genArg ], EntFullName Types.nullable -> makeNullableTypeAnnotation com ctx genArg
885-
886887 | _, Patterns.Try ( tryNativeOrFableLibraryInterface com ctx genArgs) ta -> ta
887888
888889 | _, Patterns.Try ( Lib.tryJsConstructorFor Annotation com ctx) entRef ->
@@ -1978,6 +1979,16 @@ module Util =
19781979 | Fable.Value( Fable.Null _, _), e
19791980 | e, Fable.Value( Fable.Null _, _) ->
19801981 com.TransformAsExpr( ctx, e) |> makeNullCheck range ( op = BinaryEqual)
1982+ | ExprType( Fable.Nullable _), ExprType( Fable.Nullable _) ->
1983+ Replacements.Util.Helper.LibCall(
1984+ com,
1985+ " Util" ,
1986+ " nullableEquals" ,
1987+ Fable.Boolean,
1988+ [ e1; e2 ],
1989+ ?loc = range
1990+ )
1991+ |> transformAsExpr com ctx
19811992 | ExprType( Fable.MetaType), _ ->
19821993 let e =
19831994 Replacements.Util.Helper.LibCall(
0 commit comments