Skip to content

Commit 7b13b78

Browse files
auduchinokbaronfel
authored andcommitted
Make FSharpAccessibility.IsProtected public, optimize IsPublic property (#6847)
1 parent 027424c commit 7b13b78

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

src/fsharp/symbols/Symbols.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ type FSharpAccessibility(a:Accessibility, ?isProtected) =
3434
| _ when List.forall isInternalCompPath p -> Internal
3535
| _ -> Private
3636

37-
member __.IsPublic = not isProtected && match a with Public -> true | _ -> false
37+
member __.IsPublic = not isProtected && match a with TAccess [] -> true | _ -> false
3838

3939
member __.IsPrivate = not isProtected && match a with Private -> true | _ -> false
4040

src/fsharp/symbols/Symbols.fsi

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,20 @@ type internal SymbolEnv =
2525
type public FSharpAccessibility =
2626
internal new: Accessibility * ?isProtected: bool -> FSharpAccessibility
2727

28-
/// Indicates the symbol has public accessibility
29-
member IsPublic : bool
28+
/// Indicates the symbol has public accessibility.
29+
member IsPublic: bool
3030

31-
/// Indicates the symbol has private accessibility
32-
member IsPrivate : bool
31+
/// Indicates the symbol has private accessibility.
32+
member IsPrivate: bool
3333

34-
/// Indicates the symbol has internal accessibility
35-
member IsInternal : bool
34+
/// Indicates the symbol has internal accessibility.
35+
member IsInternal: bool
36+
37+
/// Indicates the symbol has protected accessibility.
38+
member IsProtected: bool
3639

3740
/// The underlying Accessibility
38-
member internal Contents : Accessibility
41+
member internal Contents: Accessibility
3942

4043

4144
/// Represents the information needed to format types and other information in a style

0 commit comments

Comments
 (0)