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 #5485 from MartinNowak/fix314
fix Issue 314 - static, renamed, and selective imports are always public
- Loading branch information
Showing
12 changed files
with
101 additions
and
36 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,5 @@ | ||
module imports.pkg.a314; // sub package | ||
|
||
package(imports) static import imports.c314; | ||
package(imports) import renamed = imports.c314; | ||
package(imports) import imports.c314 : 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,4 @@ | ||
module imports.c314; | ||
|
||
void bug(string s) | ||
{} |
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,11 @@ | ||
// REQUIRED_ARGS: -de | ||
module imports.test314; // package imports | ||
|
||
import imports.a314; | ||
|
||
void main() | ||
{ | ||
imports.a314.bug("This should work.\n"); | ||
renamed.bug("This should work.\n"); | ||
bug("This should work.\n"); | ||
} |
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,5 @@ | ||
module imports.a314; | ||
|
||
static import imports.c314; | ||
import renamed = imports.c314; | ||
import imports.c314 : 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,4 @@ | ||
module imports.b314; | ||
|
||
package import renamedpkg = imports.c314; | ||
package import imports.c314 : bugpkg=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,4 @@ | ||
module imports.c314; | ||
|
||
void bug(string s) | ||
{} |
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
import ice9865; | ||
public import ice9865; | ||
class Bar { Foo foo; } |
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,25 @@ | ||
/* | ||
REQUIRED_ARGS: -de | ||
TEST_OUTPUT: | ||
--- | ||
fail_compilation/test314.d(3): Deprecation: imports.a314.renamed is not visible from module test314 | ||
fail_compilation/test314.d(4): Deprecation: imports.a314.bug is not visible from module test314 | ||
fail_compilation/test314.d(6): Deprecation: imports.b314.renamedpkg is not visible from module test314 | ||
fail_compilation/test314.d(7): Deprecation: imports.b314.bugpkg is not visible from module test314 | ||
--- | ||
*/ | ||
|
||
module test314; | ||
|
||
import imports.a314; | ||
import imports.b314; | ||
|
||
#line 1 | ||
void main() | ||
{ | ||
renamed.bug("This should not work.\n"); | ||
bug("This should not work.\n"); | ||
|
||
renamedpkg.bug("This should not work.\n"); | ||
bugpkg("This should not work.\n"); | ||
} |