We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9f51ac5 commit dc8bc8dCopy full SHA for dc8bc8d
1 file changed
src/fsharp/TastOps.fs
@@ -5951,12 +5951,15 @@ let isRecdOrStructTyconRefAssumedImmutable (g: TcGlobals) (tcref: TyconRef) =
5951
5952
let isTyconRefReadOnly g m (tcref: TyconRef) =
5953
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
+ if
+ match tcref.TryIsReadOnly with
+ | ValueSome res -> res
+ | _ ->
+ let res = TyconRefHasAttribute g m g.attrib_IsReadOnlyAttribute tcref
+ tcref.SetIsReadOnly res
5960
+ res
5961
+ then true
5962
+ else tcref.IsEnumTycon
5963
5964
let isTyconRefAssumedReadOnly g (tcref: TyconRef) =
5965
0 commit comments