You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tests/FSharp.Compiler.ComponentTests/Conformance/TypesAndTypeConstraints/IWSAMsAndSRTPs/testFiles/CheckNewSyntax.fs
+30-6Lines changed: 30 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -4,19 +4,31 @@ module CheckNewSyntax =
4
4
5
5
typeMyType()=
6
6
static member valStaticProperty=0with get, set
7
-
static memberStaticMethod x = x +5
7
+
static memberStaticMethod0()=5
8
+
static memberStaticMethod1 x = x +5
9
+
static memberStaticMethod2(x,y)= x + y +5
8
10
member valLength=0with get, set
9
11
member_.Itemwith get x ="Hello"
10
-
member_.InstanceMethod x = x +5
12
+
member_.InstanceMethod0()=5
13
+
member_.InstanceMethod1 x = x +5
14
+
member_.InstanceMethod2(x,y)= x + y +5
11
15
12
16
// Check that "property" and "get_ method" constraints are considered logically equivalent
13
17
let inlinef_StaticProperty<'Twhen'T:(static member StaticProperty:int)>():int = 'T.StaticProperty
14
18
15
-
let inlinef_StaticMethod<'Twhen'T:(static member StaticMethod:int ->int)>():int = 'T.StaticMethod(3)
19
+
let inlinef_StaticMethod0<'Twhen'T:(static member StaticMethod0:unit ->int)>():int = 'T.StaticMethod0()
20
+
21
+
let inlinef_StaticMethod1<'Twhen'T:(static member StaticMethod1:int ->int)>():int = 'T.StaticMethod1(3)
22
+
23
+
let inlinef_StaticMethod2<'Twhen'T:(static member StaticMethod2:int *int ->int)>():int = 'T.StaticMethod2(3,3)
16
24
17
25
let inlinef_set_StaticProperty<'Twhen'T:(static member StaticProperty:int with set)>()= 'T.set_StaticProperty(3)
18
26
19
-
let inlinef_InstanceMethod<'Twhen'T:(member InstanceMethod:int ->int)>(x:'T):int = x.InstanceMethod(3)
27
+
let inlinef_InstanceMethod0<'Twhen'T:(member InstanceMethod0:unit ->int)>(x:'T):int = x.InstanceMethod0()
28
+
29
+
let inlinef_InstanceMethod1<'Twhen'T:(member InstanceMethod1:int ->int)>(x:'T):int = x.InstanceMethod1(3)
30
+
31
+
let inlinef_InstanceMethod2<'Twhen'T:(member InstanceMethod2:int *int ->int)>(x:'T):int = x.InstanceMethod2(3,3)
20
32
21
33
let inlinef_Length<'Twhen'T:(member Length:int)>(x:'T)= x.Length
22
34
@@ -33,7 +45,13 @@ module CheckNewSyntax =
33
45
//let inline f_set_Length2<'T when 'T : (member Length: int with set) >(x: 'T) = x.Length <- 3
34
46
//let inline f_Item2<'T when 'T : (member Item: int -> string with get) >(x: 'T) = x[3]
0 commit comments