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 module values can be mutated by other modules #27

Closed
latkin opened this issue Jan 16, 2015 · 0 comments
Closed

Private module values can be mutated by other modules #27

latkin opened this issue Jan 16, 2015 · 0 comments
Labels

Comments

@latkin
Copy link
Contributor

latkin commented Jan 16, 2015

Reported by a user on Twitter, but they have not followed up, so I'll open it here. The below code compiles, despite the illegal access:

module A =
    let mutable private x = 0

module B = 
    let test () =
        // let _ = A.x  // accessibility error on read, as expected
        A.x <- 1     // but write works!

This repros at least as far back as 3.0.

@latkin latkin added the Bug label Jan 16, 2015
@dsyme dsyme mentioned this issue Jan 17, 2015
@dsyme dsyme closed this as completed in c5e6699 Jan 20, 2015
@latkin latkin added the fixed label Jan 20, 2015
forki referenced this issue in forki/visualfsharp Jan 21, 2015
fixes #27
resolves #28

commit bf3c9b3ff6151a09dd9319e5e54d21a0edd17c31
Merge: 5eb0657 7393d92
Author: latkin <[email protected]>
Date:   Mon Jan 19 16:57:58 2015 -0800

    Merge branch 'private-val-fix' of https://github.com/dsyme/visualfsharp into dsyme-private-val-fix

commit 7393d92
Author: Don Syme <[email protected]>
Date:   Sat Jan 17 11:50:54 2015 +0000

    add tests for val sets

commit 68555a3
Author: Don Syme <[email protected]>
Date:   Sat Jan 17 11:38:18 2015 +0000

    adjust range reported in error

commit bff938f
Author: Don Syme <[email protected]>
Date:   Sat Jan 17 11:35:08 2015 +0000

    fix compile

commit d2f12e4
Author: Don Syme <[email protected]>
Date:   Sat Jan 17 11:33:41 2015 +0000

    fix for private val set
dsyme pushed a commit to dsyme/fsharp that referenced this issue Jul 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants