Skip to content

Commit c1b6afb

Browse files
fix fsfromfsviacs build
1 parent 9a3a242 commit c1b6afb

File tree

2 files changed

+11
-15
lines changed

2 files changed

+11
-15
lines changed

tests/fsharp/core/fsfromfsviacs/lib.fs

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,15 @@ let tup3 = (2,3,4)
4242
let tup4 = (2,3,4,5)
4343

4444

45+
type OptionalParameterTests =
46+
static member MethodWithOptionalParams<'T>(?value1 : 'T, ?value2 : int) = (value1, value2)
4547

48+
static member FSharpMethodThatConsumesOptionalParams() =
49+
let _ = OptionalParameterTests.MethodWithOptionalParams<int>()
50+
let _ = OptionalParameterTests.MethodWithOptionalParams<int>(42)
51+
let _ = OptionalParameterTests.MethodWithOptionalParams<int>(value2 = 42)
52+
let _ = OptionalParameterTests.MethodWithOptionalParams<int>(42, ?value2 = None)
53+
()
4654

4755

4856
module StructUnionsTests =
@@ -111,17 +119,4 @@ module NestedStructUnionsTests =
111119
let testPattern3mut(u2:U2) =
112120
let mutable u2 = u2
113121
match u2 with
114-
| U2(U1(dt1,"a"),U1(dt2,"b")) -> (dt1 = dt2)
115-
116-
117-
module OptionalParameterTests =
118-
119-
type API =
120-
static member MethodWithOptionalParams<'T>(?value1 : 'T, ?value2 : int) = (value1, value2)
121-
122-
static member FSharpMethodThatConsumesOptionalParams() =
123-
let _ = API.MethodWithOptionalParams<int>()
124-
let _ = API.MethodWithOptionalParams<int>(42)
125-
let _ = API.MethodWithOptionalParams<int>(value2 = 42)
126-
let _ = API.MethodWithOptionalParams<int>(42, ?value2 = None)
127-
()
122+
| U2(U1(dt1,"a"),U1(dt2,"b")) -> (dt1 = dt2)

tests/fsharp/core/fsfromfsviacs/lib2.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using System;
12
using Microsoft.FSharp;
23
using Microsoft.FSharp.Core;
34
using Microsoft.FSharp.Collections;
@@ -67,7 +68,7 @@ public class ApiWrapper
6768
{
6869
public static Tuple<FSharpOption<T>, FSharpOption<int>> MethodWithOptionalParams<T>(T value1, int value2)
6970
{
70-
return OptionalParameterTests.API.MethodWithOptionalParams<T>(value1 = value1, value2 = value2);
71+
return Lib.OptionalParameterTests.MethodWithOptionalParams<T>(value1 = value1, value2 = value2);
7172
}
7273

7374
public static int MethodThatImplicitlyConvertsFSharpOption(int x)

0 commit comments

Comments
 (0)