Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix Issue 15900 - public imports not accessible using FQN
- public imports in imported modules were not accessbile using their FQN, this was an oversight when adding the package tree masking to fix Bugzilla 313 (see #5426) - fixed by recursively checking imported scopes for accessible packages - reuse Module.insearch to not follow import cycles - Uses the same reduced visibility distinction (only private vs. rest) as the unqualified symbol search, b/c extending importedScopes to track rich visibility (e.g. package(a.b)) was out of scope for a regression fix. This should be implemented when combining the search/import w/ the symbol visibility mechanism.
- Loading branch information
1 parent
2e620d1
commit 0a20f1d
Showing
11 changed files
with
84 additions
and
13 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
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,24 @@ | ||
module imports.g313; | ||
|
||
// adds public package imports (see Bugzilla 15900) | ||
public import imports.g313public; | ||
// same w/ deferred semantics | ||
static if (true) | ||
public import imports.g313staticif; | ||
mixin("public import imports.g313stringmixin;"); | ||
|
||
template impD() | ||
{ | ||
public import imports.g313templatemixin; | ||
} | ||
|
||
mixin impD!(); | ||
|
||
void test15900() | ||
{ | ||
// publically imported modules should obviously be available in here as well | ||
imports.g313public.bug(); | ||
imports.g313staticif.bug(); | ||
imports.g313stringmixin.bug(); | ||
imports.g313templatemixin.bug(); | ||
} |
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,3 @@ | ||
void bug() | ||
{ | ||
} |
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,3 @@ | ||
void bug() | ||
{ | ||
} |
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,3 @@ | ||
void bug() | ||
{ | ||
} |
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,3 @@ | ||
void bug() | ||
{ | ||
} |
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,12 @@ | ||
// REQUIRED_ARGS: -de | ||
// EXTRA_SOURCES: imports/g313.d | ||
import imports.g313; | ||
|
||
void test15900() | ||
{ | ||
// publically imported modules from g313 should be available here | ||
imports.g313public.bug(); | ||
imports.g313staticif.bug(); | ||
imports.g313stringmixin.bug(); | ||
imports.g313templatemixin.bug(); | ||
} |