Skip to content

Commit 5fe03ea

Browse files
committed
Fix 452 - FSharpField.IsMutable = true for BCL enum cases
1 parent 7e7bcdd commit 5fe03ea

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/fsharp/vs/Symbols.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,7 @@ and FSharpField(cenv, d: FSharpFieldData) =
656656
if isUnresolved() then false else
657657
match d.TryRecdField with
658658
| Choice1Of2 r -> r.IsMutable
659-
| Choice2Of2 f -> not f.IsInitOnly
659+
| Choice2Of2 f -> not f.IsInitOnly && f.LiteralValue.IsNone
660660

661661
member __.IsLiteral =
662662
if isUnresolved() then false else

tests/service/ProjectAnalysisTests.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2907,7 +2907,7 @@ let ``Test Project19 all symbols`` () =
29072907
("DayOfWeek", "DayOfWeek", "file1", ((10, 15), (10, 24)), [],
29082908
["enum"; "valuetype"]);
29092909
("System", "System", "file1", ((10, 8), (10, 14)), [], ["namespace"]);
2910-
("field Monday", "Monday", "file1", ((10, 8), (10, 31)), [], ["field"; "mutable"; "static"; "1"]);
2910+
("field Monday", "Monday", "file1", ((10, 8), (10, 31)), [], ["field"; "static"; "1"]);
29112911
("val s", "s", "file1", ((10, 4), (10, 5)), ["defn"], ["val"]);
29122912
("Impl", "Impl", "file1", ((2, 7), (2, 11)), ["defn"], ["module"])|]
29132913

0 commit comments

Comments
 (0)