Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4104 from 9rnsr/fix10528
Issue 10528 - Private constant (enum) properties not private
- Loading branch information
Showing
5 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
TEST_OUTPUT: | ||
--- | ||
fail_compilation/fail10528.d(19): Error: module fail10528 variable a10528.a is private | ||
fail_compilation/fail10528.d(20): Error: variable a10528.a is not accessible from module fail10528 | ||
fail_compilation/fail10528.d(22): Error: variable a10528.b is not accessible from module fail10528 | ||
fail_compilation/fail10528.d(23): Error: variable a10528.b is not accessible from module fail10528 | ||
fail_compilation/fail10528.d(25): Error: variable a10528.S.c is not accessible from module fail10528 | ||
fail_compilation/fail10528.d(26): Error: variable a10528.S.c is not accessible from module fail10528 | ||
fail_compilation/fail10528.d(28): Error: variable a10528.C.d is not accessible from module fail10528 | ||
fail_compilation/fail10528.d(29): Error: variable a10528.C.d is not accessible from module fail10528 | ||
--- | ||
*/ | ||
|
||
import imports.a10528; | ||
|
||
void main() | ||
{ | ||
auto a1 = a; | ||
auto a2 = imports.a10528.a; | ||
|
||
auto b1 = b; | ||
auto b2 = imports.a10528.b; | ||
|
||
auto c1 = S.c; | ||
with (S) auto c2 = c; | ||
|
||
auto d1 = C.d; | ||
with (C) auto d2 = d; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
private enum string a = "asdfgh"; | ||
private enum { b = "asdfgh" } | ||
|
||
struct S { private enum string c = "qwerty"; } | ||
class C { private enum string d = "qwerty"; } | ||
|