-
-
Notifications
You must be signed in to change notification settings - Fork 606
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix Issue 16085 - wrong visibility warning for overloaded alias symbol
- mark OverDeclaration as overloadable - mark AliasDeclaration as overloadable (depends on aliasee) - replace overloadApply with a custom iteration b/c aliases must not be resolved for visibility checks (i.e. public aliases to private symbols are public) - deal with the messy overloading of aliasees (see comments)
- Loading branch information
1 parent
5a16fbb
commit 22dc481
Showing
7 changed files
with
201 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
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,29 @@ | ||
struct Pass | ||
{ | ||
} | ||
|
||
struct S | ||
{ | ||
import imports.imp16085b : functionAndFunction, staticFunctionAndFunction, | ||
functionAndTemplate, templateAndTemplate; //<- private | ||
// public | ||
Pass functionAndFunction() | ||
{ | ||
return Pass(); | ||
} | ||
|
||
static Pass staticFunctionAndFunction() | ||
{ | ||
return Pass(); | ||
} | ||
|
||
Pass functionAndTemplate() | ||
{ | ||
return Pass(); | ||
} | ||
|
||
Pass templateAndTemplate()() | ||
{ | ||
return Pass(); | ||
} | ||
} |
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 @@ | ||
import imp16085 : S; | ||
|
||
struct Fail | ||
{ | ||
} | ||
|
||
Fail functionAndFunction(ref S) | ||
{ | ||
return Fail(); | ||
} | ||
|
||
Fail staticFunctionAndFunction(int) | ||
{ | ||
return Fail(); | ||
} | ||
|
||
Fail functionAndTemplate(T)(T) | ||
{ | ||
return Fail(); | ||
} | ||
|
||
Fail templateAndTemplate(T)(T) | ||
{ | ||
return Fail(); | ||
} |
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,13 @@ | ||
// REQUIRED_ARGS: -de | ||
// PERMUTE_ARGS: | ||
import imports.imp16085; | ||
|
||
void test() | ||
{ | ||
S s; | ||
assert(s.functionAndFunction() == Pass()); | ||
assert(s.staticFunctionAndFunction() == Pass()); | ||
// assert(S.staticFunctionAndFunction() == Pass()); // erroneous not accessible error | ||
assert(s.functionAndTemplate() == Pass()); | ||
assert(s.templateAndTemplate() == Pass()); | ||
} |
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,3 +1,4 @@ | ||
// REQUIRED_ARGS: -de | ||
import imports.test6013; | ||
|
||
static assert(__traits(compiles, public_alias_value)); | ||
|