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/Conformance/Properties/ILMemberAccessTests.fs
+11-2Lines changed: 11 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -91,6 +91,7 @@ type MyFSharpClass () =
91
91
(FSharpErrorSeverity.Error,491,(34,9,34,40),
92
92
"The member or object constructor 'GetPublicSetPrivate' is not accessible. Private members may only be accessed from within the declaring type. Protected members may only be accessed from an extending type and cannot be accessed from inner lambda expressions.")|])
93
93
94
+
94
95
[<Test>]
95
96
let``VerifyVisibility of Properties C# class F# non-derived class --AccessPublicStuff`` ()=
96
97
@@ -161,6 +162,13 @@ type MyFSharpClass () =
161
162
162
163
this.GetPublicSetPrivate <- "1" // Inaccessible
163
164
let _ = this.GetPublicSetPrivate // Accessible
165
+
166
+
this.SetPublicGetInternal <- "1" // Accessible
167
+
let _ = this.SetPublicGetInternal // Inaccessible
168
+
169
+
this.SetPublicGetPrivate <- "1" // Accessible
170
+
let _ = this.SetPublicGetPrivate // accessible
171
+
164
172
()
165
173
"""
166
174
@@ -173,7 +181,9 @@ type MyFSharpClass () =
173
181
174
182
CompilerAssert.CompileWithErrors(fsCmpl,[|
175
183
(FSharpErrorSeverity.Error,810,(25,9,25,33),
176
-
"Property 'GetPublicSetPrivate' cannot be set")
184
+
"Property 'GetPublicSetPrivate' cannot be set");
185
+
(FSharpErrorSeverity.Error,807,(32,17,32,41),
186
+
"Property 'SetPublicGetPrivate' is not readable")
177
187
|])
178
188
179
189
@@ -211,4 +221,3 @@ type MyFSharpClass () =
211
221
212
222
213
223
214
-
// Todo: Repeat these tests with a seperate F# assembly
0 commit comments