Make duplicate proto imports an error.
GITHUB_BREAKING_CHANGES=n/a
@@ -160,6 +160,7 @@ abstract class ImportsPass {
for (ImportedVar symbol : node.getIdentifiers()) {
String name = symbol.name();
+ if (node.getImportType() != ImportType.PROTO) {
// Ignore duplicate imports. The formatter will dedupe these and it's more convenient
// to not have a compilation error on duplicates.
String path = node.getPath() + "//" + symbol.name();
@@ -167,6 +168,7 @@ abstract class ImportsPass {
if (path.equals(duplicatePath)) {
continue;
}
+ }
// Import naming collisions. Report errors but continue checking the other symbols so we
// can report all of the errors at once.
