-
-
Notifications
You must be signed in to change notification settings - Fork 609
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 #7668 from RazvanN7/Lookup
Fix Issue 18219 - Private import inside struct leaks symbols when used as VarDeclaration types
- Loading branch information
Showing
10 changed files
with
106 additions
and
37 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| Fix Issue 18219 - Private import inside struct leaks symbols when used as VarDeclaration types | ||
|
|
||
| When implementing a struct which has a local private import | ||
| the imported symbols are leaked if present in a VarDeclaration statement. For more information and examples see : https://issues.dlang.org/show_bug.cgi?id=18219 | ||
|
|
||
| Symbols from the private import should not visible outside the | ||
| struct scope. A deprecation is now issued when such cases are | ||
| encountered |
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
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,19 @@ | ||
| // EXTRA_SOURCES: imports/b18219.d | ||
| /* | ||
| TEST_OUTPUT: | ||
| --- | ||
| fail_compilation/fail18219.d(15): Deprecation: `b18219.Foobar` is not visible from module `fail18219` | ||
| fail_compilation/fail18219.d(16): Error: no property `Bar` for type `AST` | ||
| fail_compilation/fail18219.d(17): Error: no property `fun` for type `AST`, did you mean `b18219.fun`? | ||
| fail_compilation/fail18219.d(18): Error: no property `Foobar` for type `AST`, did you mean `b18219.Foobar`? | ||
| --- | ||
| */ | ||
| import imports.a18219; | ||
|
|
||
| void main() | ||
| { | ||
| AST.Foobar t; | ||
| AST.Bar l; | ||
| AST.fun(); | ||
| AST.Foobar.smeth(); | ||
| } |
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,6 @@ | ||
| module a18219; | ||
|
|
||
| struct AST | ||
| { | ||
| import b18219; | ||
| } |
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,15 @@ | ||
| module b18219; | ||
|
|
||
| class Foobar | ||
| { | ||
| int a; | ||
| this(int a) | ||
| { | ||
| this.a = a; | ||
| } | ||
| static int smeth() | ||
| { | ||
| return 1; | ||
| } | ||
| } | ||
| void fun() {} |