@@ -660,8 +660,11 @@ let makePojo (com: Compiler) caseRule keyValueList =
660660 let name = defaultArg uci.CompiledName uci.Name
661661 makeObjMember caseRule name values:: acc |> Some
662662 | Some acc, MaybeCasted( Value( NewTuple(( StringConst name):: values,_),_)) ->
663- // Don't change the case for tuples in disguise
664- makeObjMember Core.CaseRules.None name values:: acc |> Some
663+ match values with
664+ | [ MaybeCasted( Value( NewOption( None, _, _), _))] -> Some acc
665+ | values ->
666+ // Don't change the case for tuples in disguise
667+ makeObjMember Core.CaseRules.None name values:: acc |> Some
665668 | _ -> None))
666669 |> Option.map ( fun members -> ObjectExpr( members, Any, None))
667670
@@ -1056,8 +1059,13 @@ let operators (com: ICompiler) (ctx: Context) r t (i: CallInfo) (thisArg: Expr o
10561059 Helper.GlobalCall( " Math" , t, args, argTypes, memb= meth, ?loc= r)
10571060
10581061 match i.CompiledName, args with
1059- | ( " DefaultArg" | " DefaultValueArg" ), _ ->
1060- Helper.LibCall( com, " Option" , " defaultArg" , t, args, i.SignatureArgTypes, ?loc= r) |> Some
1062+ | ( " DefaultArg" | " DefaultValueArg" ), [ opt; defValue] ->
1063+ match opt with
1064+ | MaybeInScope ctx ( Value( NewOption( opt, _, _),_)) ->
1065+ match opt with
1066+ | Some value -> Some value
1067+ | None -> Some defValue
1068+ | _ -> Helper.LibCall( com, " Option" , " defaultArg" , t, args, i.SignatureArgTypes, ?loc= r) |> Some
10611069 | " DefaultAsyncBuilder" , _ ->
10621070 makeImportLib com t " singleton" " AsyncBuilder" |> Some
10631071 // Erased operators.
0 commit comments