Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Private inline records can be mutated #7278

vicuna opened this issue Jun 24, 2016 · 2 comments


None yet
2 participants
Copy link

commented Jun 24, 2016

Original bug ID: 7278
Reporter: @chambart
Assigned to: @alainfrisch
Status: closed (set by @xavierleroy on 2017-09-24T15:33:01Z)
Resolution: fixed
Priority: normal
Severity: major
Version: 4.03.0
Fixed in version: 4.04.0 +dev / +beta1 / +beta2
Category: typing
Monitored by: @gasche @hcarty

Bug description

Private records shouldn't be mutable, but the check is not applied for inline records.

For instance this shouldn't be accepted:

type a = private A of { mutable i : int }
let f (A r) = r.i <- 3


This comment has been minimized.

Copy link

commented Jun 24, 2016

Comment author: @gasche

I didn't actually know that privacy prevented field mutations (I would have used this in my Xml-light patch otherwise)! Thanks.


This comment has been minimized.

Copy link

commented Jun 27, 2016

Comment author: @alainfrisch

Fixed by commit 030f6d6. Thanks for the report!

@vicuna vicuna closed this Sep 24, 2017

@vicuna vicuna added the typing label Mar 14, 2019

@vicuna vicuna added the bug label Mar 20, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.