D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 15896 - private ignored when import bindings are used
Summary: private ignored when import bindings are used
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86_64 Linux
: P1 major
Assignee: No Owner
URL:
Keywords:
: 16556 (view as issue list)
Depends on:
Blocks:
 
Reported: 2016-04-08 09:06 UTC by Atila Neves
Modified: 2017-08-07 13:15 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Atila Neves 2016-04-08 09:06:41 UTC
foo.d:

import bar;
int func() { thebar + 1; }

bar.d:
private int thebar = 4;

Compilation fails as expected since `thebar` is private. But change the import in foo.d to:

import bar: thebar;

And suddenly thebar isn't so private anymore.
Comment 1 ag0aep6g 2016-09-27 21:12:09 UTC
*** Issue 16556 has been marked as a duplicate of this issue. ***
Comment 2 github-bugzilla 2017-04-03 19:03:45 UTC
Commits pushed to master at https://github.com/dlang/dmd

https://github.com/dlang/dmd/commit/ffcc380b9c06785b32c9db4eb2d392d89dcc661c
Fix Issue 15896 - private ignored when import bindings are used

https://github.com/dlang/dmd/commit/7d934731c124d70afaf7f795db039a6a887b46fd
Merge pull request #6660 from RazvanN7/Issue_15896

Fix Issue 15896 - private ignored when import bindings are used
merged-on-behalf-of: Andrei Alexandrescu <andralex@users.noreply.github.com>
Comment 3 github-bugzilla 2017-04-03 19:45:35 UTC
Commit pushed to revert-6660-Issue_15896 at https://github.com/dlang/dmd

https://github.com/dlang/dmd/commit/423c52204b45e5e01f17c106d1f254cdaa6c7a50
Revert "Fix Issue 15896 - private ignored when import bindings are used"
Comment 4 github-bugzilla 2017-04-03 20:27:11 UTC
Commits pushed to master at https://github.com/dlang/dmd

https://github.com/dlang/dmd/commit/423c52204b45e5e01f17c106d1f254cdaa6c7a50
Revert "Fix Issue 15896 - private ignored when import bindings are used"

https://github.com/dlang/dmd/commit/8d0fce421b1b55921c9827ac1d89633560a3c0a7
Merge pull request #6673 from dlang/revert-6660-Issue_15896

Revert "Fix Issue 15896 - private ignored when import bindings are used"
merged-on-behalf-of: Vladimir Panteleev <github@thecybershadow.net>
Comment 5 github-bugzilla 2017-06-17 11:33:50 UTC
Commits pushed to stable at https://github.com/dlang/dmd

https://github.com/dlang/dmd/commit/ffcc380b9c06785b32c9db4eb2d392d89dcc661c
Fix Issue 15896 - private ignored when import bindings are used

https://github.com/dlang/dmd/commit/7d934731c124d70afaf7f795db039a6a887b46fd
Merge pull request #6660 from RazvanN7/Issue_15896

https://github.com/dlang/dmd/commit/423c52204b45e5e01f17c106d1f254cdaa6c7a50
Revert "Fix Issue 15896 - private ignored when import bindings are used"

https://github.com/dlang/dmd/commit/8d0fce421b1b55921c9827ac1d89633560a3c0a7
Merge pull request #6673 from dlang/revert-6660-Issue_15896
Comment 6 github-bugzilla 2017-08-07 13:15:40 UTC
Commits pushed to newCTFE at https://github.com/dlang/dmd

https://github.com/dlang/dmd/commit/ffcc380b9c06785b32c9db4eb2d392d89dcc661c
Fix Issue 15896 - private ignored when import bindings are used

https://github.com/dlang/dmd/commit/7d934731c124d70afaf7f795db039a6a887b46fd
Merge pull request #6660 from RazvanN7/Issue_15896

https://github.com/dlang/dmd/commit/423c52204b45e5e01f17c106d1f254cdaa6c7a50
Revert "Fix Issue 15896 - private ignored when import bindings are used"

https://github.com/dlang/dmd/commit/8d0fce421b1b55921c9827ac1d89633560a3c0a7
Merge pull request #6673 from dlang/revert-6660-Issue_15896