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
let``Private type produces warning when trying to export``()=
13
+
CompilerAssert.TypeCheckSingleError
14
+
"""
15
+
module Library =
16
+
type private Hidden = Hidden of unit
17
+
type Exported = Hidden
18
+
"""
19
+
FSharpErrorSeverity.Warning
20
+
44
21
+
(4,8,4,16)
22
+
("This construct is deprecated. The type 'Hidden' is less accessible than the value, member or type 'Exported' it is used in."+ System.Environment.NewLine +"As of F# 4.1, the accessibility of type abbreviations is checked at compile-time. Consider changing the accessibility of the type abbreviation. Ignoring this warning might lead to runtime errors.")
23
+
24
+
[<Fact>]
25
+
let``Internal type passes when abbrev is internal``()=
26
+
CompilerAssert.Pass
27
+
"""
28
+
module Library =
29
+
type internal Hidden = Hidden of unit
30
+
type internal Exported = Hidden
31
+
"""
32
+
33
+
[<Fact>]
34
+
let``Internal type produces warning when trying to export``()=
35
+
CompilerAssert.TypeCheckSingleError
36
+
"""
37
+
module Library =
38
+
type internal Hidden = Hidden of unit
39
+
type Exported = Hidden
40
+
"""
41
+
FSharpErrorSeverity.Warning
42
+
44
43
+
(4,8,4,16)
44
+
("This construct is deprecated. The type 'Hidden' is less accessible than the value, member or type 'Exported' it is used in."+ System.Environment.NewLine +"As of F# 4.1, the accessibility of type abbreviations is checked at compile-time. Consider changing the accessibility of the type abbreviation. Ignoring this warning might lead to runtime errors.")
45
+
46
+
[<Fact>]
47
+
let``Private type produces warning when abbrev is internal``()=
48
+
CompilerAssert.TypeCheckSingleError
49
+
"""
50
+
module Library =
51
+
type private Hidden = Hidden of unit
52
+
type internal Exported = Hidden
53
+
"""
54
+
FSharpErrorSeverity.Warning
55
+
44
56
+
(4,17,4,25)
57
+
("This construct is deprecated. The type 'Hidden' is less accessible than the value, member or type 'Exported' it is used in."+ System.Environment.NewLine +"As of F# 4.1, the accessibility of type abbreviations is checked at compile-time. Consider changing the accessibility of the type abbreviation. Ignoring this warning might lead to runtime errors.")
58
+
59
+
[<Fact>]
60
+
let``Private type passes when abbrev is private``()=
61
+
CompilerAssert.Pass
62
+
"""
63
+
module Library =
64
+
type private Hidden = Hidden of unit
65
+
type private Exported = Hidden
66
+
"""
67
+
68
+
[<Fact>]
69
+
let``Default access type passes when abbrev is default``()=
FSharpErrorSeverity.Error,783,(6,9,6,19),"At least one override did not correctly implement its corresponding abstract member"
28
27
|]
29
28
30
-
[<Test>]
29
+
[<Fact>]
31
30
let``Wrong Arity``()=
32
31
CompilerAssert.TypeCheckSingleError
33
32
"""
@@ -43,7 +42,7 @@ MyType.MyMember("", 0, 0)
43
42
(7,1,7,26)
44
43
"A member or object constructor 'MyMember' taking 3 arguments is not accessible from this code location. All accessible versions of method 'MyMember' take 2 arguments."
45
44
46
-
[<Test>]
45
+
[<Fact>]
47
46
let``Method Is Not Static``()=
48
47
CompilerAssert.TypeCheckSingleError
49
48
"""
@@ -57,7 +56,7 @@ let x = Class1.X()
57
56
(5,9,5,17)
58
57
"Method or object constructor 'X' is not static"
59
58
60
-
[<Test>]
59
+
[<Fact>]
61
60
let``Matching Method With Same Name Is Not Abstract``()=
62
61
CompilerAssert.TypeCheckWithErrors
63
62
"""
@@ -75,7 +74,7 @@ let foo =
75
74
FSharpErrorSeverity.Error,783,(6,11,6,14),"At least one override did not correctly implement its corresponding abstract member"
76
75
|]
77
76
78
-
[<Test>]
77
+
[<Fact>]
79
78
let``No Matching Abstract Method With Same Name``()=
80
79
CompilerAssert.TypeCheckWithErrors
81
80
"""
@@ -89,13 +88,13 @@ let x =
89
88
}
90
89
"""
91
90
[|
92
-
FSharpErrorSeverity.Error,767,(8,14,8,34),"The member 'Function' does not correspond to any abstract or virtual method available to override or implement. Maybe you want one of the following:\r\n MyFunction"
91
+
FSharpErrorSeverity.Error,767,(8,14,8,34),"The member 'Function' does not correspond to any abstract or virtual method available to override or implement. Maybe you want one of the following:"+ System.Environment.NewLine +" MyFunction"
93
92
FSharpErrorSeverity.Error,17,(8,19,8,27),"The member 'Function : 'a * 'b -> unit' does not have the correct type to override any given virtual method"
94
-
FSharpErrorSeverity.Error,366,(7,3,9,4),"No implementation was given for those members: \r\n\t'abstract member IInterface.MyFunction : int32 * int32 -> unit'\r\n\t'abstract member IInterface.SomeOtherFunction : int32 * int32 -> unit'\r\nNote that all interface members must be implemented and listed under an appropriate 'interface' declaration, e.g. 'interface ... with member ...'."
93
+
FSharpErrorSeverity.Error,366,(7,3,9,4),"No implementation was given for those members: "+ System.Environment.NewLine +"\t'abstract member IInterface.MyFunction : int32 * int32 -> unit'"+ System.Environment.NewLine +"\t'abstract member IInterface.SomeOtherFunction : int32 * int32 -> unit'"+ System.Environment.NewLine +"Note that all interface members must be implemented and listed under an appropriate 'interface' declaration, e.g. 'interface ... with member ...'."
95
94
FSharpErrorSeverity.Error,783,(7,9,7,19),"At least one override did not correctly implement its corresponding abstract member"
96
95
|]
97
96
98
-
[<Test>]
97
+
[<Fact>]
99
98
let``Member Has Multiple Possible Dispatch Slots``()=
100
99
CompilerAssert.TypeCheckWithErrors
101
100
"""
@@ -108,11 +107,11 @@ type Overload =
108
107
override __.Bar _ = 1
109
108
"""
110
109
[|
111
-
FSharpErrorSeverity.Error,366,(7,15,7,24),"No implementation was given for those members: \r\n\t'abstract member IOverload.Bar : double -> int'\r\n\t'abstract member IOverload.Bar : int -> int'\r\nNote that all interface members must be implemented and listed under an appropriate 'interface' declaration, e.g. 'interface ... with member ...'."
112
-
FSharpErrorSeverity.Error,3213,(8,21,8,24),"The member 'Bar<'a0> : 'a0 -> int' matches multiple overloads of the same method.\nPlease restrict it to one of the following:\r\nBar : double -> int\r\n Bar : int -> int."
110
+
FSharpErrorSeverity.Error,366,(7,15,7,24),"No implementation was given for those members: "+ System.Environment.NewLine +"\t'abstract member IOverload.Bar : double -> int'"+ System.Environment.NewLine +"\t'abstract member IOverload.Bar : int -> int'"+ System.Environment.NewLine +"Note that all interface members must be implemented and listed under an appropriate 'interface' declaration, e.g. 'interface ... with member ...'."
111
+
FSharpErrorSeverity.Error,3213,(8,21,8,24),"The member 'Bar<'a0> : 'a0 -> int' matches multiple overloads of the same method.\nPlease restrict it to one of the following:"+ System.Environment.NewLine +"Bar : double -> int"+ System.Environment.NewLine +" Bar : int -> int."
0 commit comments