-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Consider visibility when resolving wildcard imports
As reported in bazelbuild/bazel#21509 PiperOrigin-RevId: 611478456
- Loading branch information
Showing
6 changed files
with
76 additions
and
16 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
21 changes: 21 additions & 0 deletions
21
javatests/com/google/turbine/lower/testdata/star_import_visibility.test
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,21 @@ | ||
=== a/Lib.java === | ||
package a; | ||
class Lib { | ||
} | ||
=== b/Lib.java === | ||
package b; | ||
public class Lib { | ||
} | ||
=== T.java === | ||
import a.*; // a.Lib is not visible, b.Lib should be resolved | ||
import b.*; | ||
class T { | ||
Lib x; | ||
} | ||
=== a/SamePackage.java === | ||
package a; | ||
import a.*; // a.Lib is visible | ||
import b.*; | ||
class SamePackage { | ||
Lib x; | ||
} |
22 changes: 22 additions & 0 deletions
22
javatests/com/google/turbine/lower/testdata/star_import_visibility_nested.test
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,22 @@ | ||
=== a/Lib.java === | ||
package a; | ||
public class Lib { | ||
protected static class Inner {} | ||
} | ||
=== b/Lib.java === | ||
package b; | ||
public class Lib { | ||
public static class Inner {} | ||
} | ||
=== T.java === | ||
import a.Lib.*; | ||
import b.Lib.*; | ||
class T { | ||
Inner x; | ||
} | ||
=== S.java === | ||
import static a.Lib.*; | ||
import static b.Lib.*; | ||
class S { | ||
Inner x; | ||
} |