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

Closed
vicuna opened this issue Jun 24, 2016 · 2 comments
Closed

Private inline records can be mutated #7278

vicuna opened this issue Jun 24, 2016 · 2 comments
Assignees
Labels

Comments

@vicuna
Copy link

@vicuna vicuna 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

@vicuna
Copy link
Author

@vicuna vicuna 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.

@vicuna
Copy link
Author

@vicuna vicuna 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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.