@@ -1687,11 +1687,11 @@ let options isStruct (com: ICompiler) (_: Context) r (t: Type) (i: CallInfo) (th
16871687 | " get_IsNone" , Some c -> Test( c, OptionTest false , r) |> Some
16881688 | _ -> None
16891689
1690- let optionModule ( com : ICompiler ) ( ctx : Context ) r ( t : Type ) ( i : CallInfo ) ( _ : Expr option ) ( args : Expr list ) =
1690+ let optionModule isStruct ( com : ICompiler ) ( ctx : Context ) r ( t : Type ) ( i : CallInfo ) ( _ : Expr option ) ( args : Expr list ) =
16911691 let toArray r t arg =
16921692 Helper.LibCall( com, " Option" , " toArray" , Array( t, MutableArray), [ arg], ?loc= r)
16931693 match i.CompiledName, args with
1694- | " None" , _ -> NewOption( None, t, false ) |> makeValue r |> Some
1694+ | " None" , _ -> NewOption( None, t, isStruct ) |> makeValue r |> Some
16951695 | " GetValue" , [ c] ->
16961696 Helper.LibCall( com, " Option" , " value" , t, args, ?loc= r) |> Some
16971697 | ( " OfObj" | " OfNullable" ), _ ->
@@ -2900,7 +2900,8 @@ let private replacedModules =
29002900 Types.option, options false
29012901 Types.valueOption, options true
29022902 " System.Nullable`1" , nullables
2903- " Microsoft.FSharp.Core.OptionModule" , optionModule
2903+ " Microsoft.FSharp.Core.OptionModule" , optionModule false
2904+ " Microsoft.FSharp.Core.ValueOption" , optionModule true
29042905 " Microsoft.FSharp.Core.ResultModule" , results
29052906 Types.bigint, bigints
29062907 " Microsoft.FSharp.Core.NumericLiterals.NumericLiteralI" , bigints
0 commit comments