Skip to content

Commit dc8bc8d

Browse files
TIHancartermp
authored andcommitted
Enums are always read-only (#7434)
* Enums are always read-only * Minor cleanup
1 parent 9f51ac5 commit dc8bc8d

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/fsharp/TastOps.fs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5951,12 +5951,15 @@ let isRecdOrStructTyconRefAssumedImmutable (g: TcGlobals) (tcref: TyconRef) =
59515951

59525952
let isTyconRefReadOnly g m (tcref: TyconRef) =
59535953
tcref.CanDeref &&
5954-
match tcref.TryIsReadOnly with
5955-
| ValueSome res -> res
5956-
| _ ->
5957-
let res = TyconRefHasAttribute g m g.attrib_IsReadOnlyAttribute tcref
5958-
tcref.SetIsReadOnly res
5959-
res
5954+
if
5955+
match tcref.TryIsReadOnly with
5956+
| ValueSome res -> res
5957+
| _ ->
5958+
let res = TyconRefHasAttribute g m g.attrib_IsReadOnlyAttribute tcref
5959+
tcref.SetIsReadOnly res
5960+
res
5961+
then true
5962+
else tcref.IsEnumTycon
59605963

59615964
let isTyconRefAssumedReadOnly g (tcref: TyconRef) =
59625965
tcref.CanDeref &&

0 commit comments

Comments
 (0)